From: yomguy Date: Tue, 13 Nov 2007 01:57:31 +0000 (+0000) Subject: Fix tests X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=8e84de4a3f33e971b14504eb1c49cccce7492f07;p=cnaq.git Fix tests git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@102 5fc3e0e6-29bc-4d03-b52b-c088cb822bde --- diff --git a/CNACQ.m b/CNACQ.m index c4df7ac..22decc9 100644 --- a/CNACQ.m +++ b/CNACQ.m @@ -554,7 +554,7 @@ function mes_on_Callback(hObject, eventdata, handles) % Synchronizing %The number of samples in the buffer (latency of the sound card in - %samples. See tests/testacqui2.m) + %samples. See tests/testacqui.m) delay = 588; zero = zeros(1,delay); % Zeros are added before and removed after diff --git a/tests/specplot.m b/tests/specplot.m index c0f35e1..90660e3 100644 --- a/tests/specplot.m +++ b/tests/specplot.m @@ -1,6 +1,7 @@ function specplot(ficpath,fic,sens,var) % plots the spectrogram of a signal % distributed as a part of fazplot +% Author : Guillaume Pellerin % PARAMETERS % ficpath: the path folder of the wav file @@ -57,4 +58,4 @@ xlabel('Fr ylabel('Phase (rad)'); title(['Phase de la réponse fréquentielle, signal : ' fic ' - paramètre : ' var]); -end \ No newline at end of file +end diff --git a/tests/testacqui.m b/tests/testacqui.m index d954e68..d644011 100644 --- a/tests/testacqui.m +++ b/tests/testacqui.m @@ -1,20 +1,24 @@ -lt=2; %s +lt=5; %s f_min=20; f_max=20000; -n=50; +n=50; t=0:1/44100:lt; -sig=chirp(t,20,lt,20000,'logarithmic'); -%sig2=wavread('excitation'); +sig=0.9*chirp(t,20,lt,20000,'logarithmic'); +len_sig = length(sig); +% sig=wavread('excitation'); for i = 1:n i pause(0.1) - inputbuffer = pa_wavplayrecord(sig',1,[44100],0,[1],[1],[1],['asio']); + inputbuffer = pa_wavplayrecord(sig',0,[44100],0,[1],[1],0,['asio']); Co=crosscorr(sig',inputbuffer',length(inputbuffer)-1); [Y(i),I(i)] = max(Co); - I(i) + I(i)-len_sig end plot(I); -axis([1 n (max(I)+2) (min(I)-2)]); +axis([1 n (min(I)+2) (max(I)-2)]); +figure() +plot(Y); +axis([1 n min(Y) max(Y)]); diff --git a/tests/testacqui2.m b/tests/testacqui2.m deleted file mode 100644 index d644011..0000000 --- a/tests/testacqui2.m +++ /dev/null @@ -1,24 +0,0 @@ -lt=5; %s -f_min=20; -f_max=20000; -n=50; - -t=0:1/44100:lt; -sig=0.9*chirp(t,20,lt,20000,'logarithmic'); -len_sig = length(sig); -% sig=wavread('excitation'); - -for i = 1:n - i - pause(0.1) - inputbuffer = pa_wavplayrecord(sig',0,[44100],0,[1],[1],0,['asio']); - Co=crosscorr(sig',inputbuffer',length(inputbuffer)-1); - [Y(i),I(i)] = max(Co); - I(i)-len_sig -end - -plot(I); -axis([1 n (min(I)+2) (max(I)-2)]); -figure() -plot(Y); -axis([1 n min(Y) max(Y)]);