From: yomguy Date: Fri, 4 Apr 2008 11:57:39 +0000 (+0000) Subject: * Add the convoluted temporal method X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=5547be25a5c95d8b875c1ec7a4961db512204a1d;p=cnaq.git * Add the convoluted temporal method git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@161 5fc3e0e6-29bc-4d03-b52b-c088cb822bde --- diff --git a/CNAQ.fig b/CNAQ.fig index e6a1b1b..3e9d3e7 100644 Binary files a/CNAQ.fig and b/CNAQ.fig differ diff --git a/CNAQ.m b/CNAQ.m index 8fb27c6..52f30c0 100644 --- a/CNAQ.m +++ b/CNAQ.m @@ -169,36 +169,11 @@ 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.mes_type,'String','Transfert function|Impulse response'); set(handles.in_on_off,'UserData',device); set(handles.save_button,'UserData',latency); -%============================================ -% TOOLS -%============================================ - -function set_fs(handles, f_s) - if f_s == 44100 - fs_ind = 1; - elseif f_s == 48000 - fs_ind = 2; - elseif f_s == 88200 - fs_ind = 3; - elseif f_s == 96000 - fs_ind = 4; - elseif f_s == 192000 - fs_ind = 5; - end - set(handles.f_s,'Value',fs_ind); - -function set_nbits(handles, nbits) - if nbits == 16 - nb_ind = 1; - elseif nbits == 24 - nb_ind = 2; - end - set(handles.nbits,'Value', nb_ind); - %============================================ % DATA %============================================ @@ -391,7 +366,7 @@ function mes_type_CreateFcn(hObject, eventdata, handles) function mes_on_Callback(hObject, eventdata, handles, device) measurement(handles) - plot_Callback(hObject, eventdata, handles) + plot_main(handles) % Close all figures % --- Executes on button press in close_button. diff --git a/tools/measurement.m b/tools/measurement.m index 2b8f2bb..ac13ef2 100644 --- a/tools/measurement.m +++ b/tools/measurement.m @@ -56,7 +56,7 @@ function measurement(handles) % Measure sig_mes = pa_wavplayrecord(sig_out, device, f_s, 0, voice_first, voice_last, device, 'asio'); % Usage: - % inputbuffer = pa_wavplayrecord(playbuffer,[playdevice],[samplerate], + % inputbuffer = pa_wavplayrecord(playbuffer,[playdevice],[samplerate], % [recnsamples], [recfirstchannel], [reclastchannel], % [recdevice], [devicetype]) diff --git a/tools/plot_main.m b/tools/plot_main.m index 179105e..e5c7ffe 100644 --- a/tools/plot_main.m +++ b/tools/plot_main.m @@ -13,9 +13,11 @@ function plot_main(handles) username = get(handles.username,'String'); comment = get(handles.comment,'String'); id = get(handles.ID,'String'); + mes_type = get(handles.mes_type,'Value'); + + % Compute excitation spectrum + [rep_imp_exc, spec_exc] = get_ri_spec(f, sig_exc, sig_exc, f_s); - % Compute excitation spectrum - [rep_imp_exc, spec_exc] = fonc_trans(f, sig_exc, sig_exc); len_spec_exc = length(spec_exc); spec_exc = spec_exc(1:len_spec_exc/2); @@ -25,7 +27,7 @@ function plot_main(handles) % Compute all Ris and specs for i=1:n_col_sig_mes voice = num2str(i); - [rep_imp_mes, spec_mes] = fonc_trans(f, sig_exc, sig_mes(:,i)); + [rep_imp_mes, spec_mes] = get_ri_spec(f, sig_exc, sig_mes(:,i), f_s); len_spec_mes = length(spec_mes); spec_mes = spec_mes(1:len_spec_mes/2); % Plot results