]> git.parisson.com Git - cnaq.git/commitdiff
Fix tests
authoryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Tue, 13 Nov 2007 01:57:31 +0000 (01:57 +0000)
committeryomguy <yomguy@5fc3e0e6-29bc-4d03-b52b-c088cb822bde>
Tue, 13 Nov 2007 01:57:31 +0000 (01:57 +0000)
git-svn-id: http://svn.parisson.org/svn/CNAQ/trunk@102 5fc3e0e6-29bc-4d03-b52b-c088cb822bde

CNACQ.m
tests/specplot.m
tests/testacqui.m
tests/testacqui2.m [deleted file]

diff --git a/CNACQ.m b/CNACQ.m
index c4df7ace8b83fa4ec0fd943157716f5ef4d7688d..22decc921b4ec20ec64a11b6f076fce707cf9f0b 100644 (file)
--- a/CNACQ.m
+++ b/CNACQ.m
@@ -554,7 +554,7 @@ function mes_on_Callback(hObject, eventdata, handles)
     \r
     % Synchronizing\r
     %The number of samples in the buffer (latency of the sound card in\r
-    %samples. See tests/testacqui2.m)\r
+    %samples. See tests/testacqui.m)\r
     delay = 588;  \r
     zero = zeros(1,delay);\r
     % Zeros are added before and removed after\r
index c0f35e1054d6019ee90743d870db8eb1459294bd..90660e367f0a9004b32592132e59cf9640276deb 100644 (file)
@@ -1,6 +1,7 @@
 function specplot(ficpath,fic,sens,var)\r
 % plots the spectrogram of a signal\r
 % distributed as a part of fazplot\r
+% Author : Guillaume Pellerin\r
 \r
 % PARAMETERS\r
 % ficpath: the path folder of the wav file\r
@@ -57,4 +58,4 @@ xlabel('Fr
 ylabel('Phase (rad)');\r
 title(['Phase de la réponse fréquentielle, signal : ' fic ' - paramètre : ' var]);\r
 \r
-end
\ No newline at end of file
+end\r
index d954e682e19e61d20119b50ca76bd20b7d82af29..d644011610bb6c4c674b503460ce52d2d1316a35 100644 (file)
@@ -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 (file)
index d644011..0000000
+++ /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)]);