From: yomguy Date: Tue, 8 Apr 2008 14:20:14 +0000 (+0000) Subject: * Add 8 channels X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=48a94c38cba3a3270a4fba88fc28ca4640aa933a;p=cnaq.git * Add 8 channels * Create an Analysis box git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@176 5fc3e0e6-29bc-4d03-b52b-c088cb822bde --- diff --git a/CNAQ.fig b/CNAQ.fig index 2a84be1..d4f963f 100644 Binary files a/CNAQ.fig and b/CNAQ.fig differ diff --git a/CNAQ.m b/CNAQ.m index f63438b..d52b03b 100644 --- a/CNAQ.m +++ b/CNAQ.m @@ -34,7 +34,7 @@ function varargout = CNAQ(varargin) % Author: Guillaume Pellerin -% Last Modified by GUIDE v2.5 12-Jan-2008 11:35:34 +% Last Modified by GUIDE v2.5 08-Apr-2008 16:23:22 % CNAQ, by itself, creates a new CNAQ or raises the existing % singleton*. @@ -166,8 +166,8 @@ set(handles.f_s,'String','44100|48000|88200|96000|192000'); set(handles.in_on_off,'Value',0); set(handles.gen_on_off,'Value',0); set(handles.sig_type,'String','Sinus|Chirp|White noise|Pink noise'); -set(handles.voices_in,'String','1|1 2|1 2 3|1 2 3 4'); -set(handles.voices_out,'String','1|1 2|1 2 3|1 2 3 4'); +set(handles.channels_in,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8'); +set(handles.channels_out,'String','1|1 2|1 2 3|1 2 3 4|1 2 3 4 5 6 7 8'); set(handles.mes_type,'String','Transfert function|Impulse response'); set(handles.in_on_off,'UserData',device); @@ -248,16 +248,16 @@ function gain_out_CreateFcn(hObject, eventdata, handles) set(hObject,'BackgroundColor',[.9 .9 .9]); end -function voices_in_Callback(hObject, eventdata, handles) +function channels_in_Callback(hObject, eventdata, handles) -function voices_in_CreateFcn(hObject, eventdata, handles) +function channels_in_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end -function voices_out_Callback(hObject, eventdata, handles) +function channels_out_Callback(hObject, eventdata, handles) -function voices_out_CreateFcn(hObject, eventdata, handles) +function channels_out_CreateFcn(hObject, eventdata, handles) if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end diff --git a/tools/get_voices_in.m b/tools/get_voices_in.m deleted file mode 100644 index 33e1eab..0000000 --- a/tools/get_voices_in.m +++ /dev/null @@ -1,14 +0,0 @@ -function voices_in = get_voices_in(handles) - - vi_ind = get(handles.voices_in,'Value'); - if vi_ind == 1 - voices_in = [1]; - elseif vi_ind == 2 - voices_in = [1 2]; - elseif vi_ind == 3 - voices_in = [1 2 3]; - elseif vi_ind == 4 - voices_in = [1 2 3 4]; - end - -end \ No newline at end of file diff --git a/tools/get_voices_out.m b/tools/get_voices_out.m deleted file mode 100644 index 0dd1f4f..0000000 --- a/tools/get_voices_out.m +++ /dev/null @@ -1,14 +0,0 @@ -function voices_out = get_voices_out(handles) - - vo_ind = get(handles.voices_out,'Value'); - if vo_ind == 1 - voices_out = [1]; - elseif vo_ind == 2 - voices_out = [1,2]; - elseif vo_ind == 3 - voices_out = [1,2,3]; - elseif vo_ind == 4 - voices_out = [1,2,3,4]; - end - -end \ No newline at end of file diff --git a/tools/measurement.m b/tools/measurement.m index 9be2f25..471f674 100644 --- a/tools/measurement.m +++ b/tools/measurement.m @@ -1,19 +1,23 @@ function measurement(handles) + % Init pause(0.2); device = get(handles.in_on_off,'UserData'); latency = get(handles.save_button,'UserData'); + nfft = 32768; f_min = str2double(get(handles.f_gen_min,'String')); f_max = str2double(get(handles.f_gen_max,'String')); + time = get(handles.time_gen,'Value'); fs_id = get(handles.f_s,'Value'); - nb_id = get(handles.nbits,'Value'); f_s = get_fs(fs_id); + nb_id = get(handles.nbits,'Value'); nbits = get_nbits(nb_id); - time = get(handles.time_gen,'Value'); - voices_in = get_voices_in(handles); - voice_first = voices_in(1); - voice_last = voices_in(length(voices_in)); + ch_in_id = get(handles.channels_in,'Value'); + channels_in = get_channels_in(ch_in_id); + channel_first = channels_in(1); + channel_last = channels_in(length(channels_in)); + gain_out = get(handles.gain_out,'Value'); gain_out = 10^(gain_out/20); @@ -50,14 +54,14 @@ function measurement(handles) sig_exc_z = [sig_exc zero]; len_sig_exc = length(sig_exc); - % Make all voices + % Init all channels sig_out = []; - for i=1:length(voices_in) + for i=1:length(channels_in) sig_out(:,i) = sig_exc_z'; end % Measure - sig_mes = pa_wavplayrecord(sig_out, device, f_s, 0, voice_first, voice_last, device, 'asio'); + sig_mes = pa_wavplayrecord(sig_out, device, f_s, 0, channel_first, channel_last, device, 'asio'); % Usage: % inputbuffer = pa_wavplayrecord(playbuffer,[playdevice],[samplerate], % [recnsamples], [recfirstchannel], [reclastchannel],