\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
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
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
-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)]);
+++ /dev/null
-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)]);