tomwalters@0
|
1 % method of class @signal
|
tomwalters@0
|
2 % function sig=autocorrelate(sig,[delay_start],[delay_stop],[normalization_mode])
|
tomwalters@0
|
3 %
|
tomwalters@0
|
4 % calculates the auto corrlelation between of the signal sig
|
tomwalters@0
|
5 % return value is a signal that covers the correlation between
|
tomwalters@0
|
6 % between delay_start and delay_stop.
|
tomwalters@0
|
7 %
|
tomwalters@0
|
8 % INPUT VALUES:
|
tomwalters@0
|
9 % sig: original @signal
|
tomwalters@0
|
10 % delay_start: start of the correlation : default -length(sig)
|
tomwalters@0
|
11 % delay_stop: longest delay of the correlation : default length(sig)
|
tomwalters@0
|
12 % normalization_mode: normalizateion: default: 'biased' (see help 'xcorr')
|
tomwalters@0
|
13 %
|
tomwalters@0
|
14 % RETURN VALUE:
|
tomwalters@0
|
15 % @sig: the correlation values at each delay
|
tomwalters@0
|
16 %
|
bleeck@3
|
17 % This external file is included as part of the 'aim-mat' distribution package
|
bleeck@3
|
18 % (c) 2011, University of Southampton
|
bleeck@3
|
19 % Maintained by Stefan Bleeck (bleeck@gmail.com)
|
bleeck@3
|
20 % download of current version is on the soundsoftware site:
|
bleeck@3
|
21 % http://code.soundsoftware.ac.uk/projects/aimmat
|
bleeck@3
|
22 % documentation and everything is on http://www.acousticscale.org
|
bleeck@3
|
23
|
tomwalters@0
|
24
|
tomwalters@0
|
25 function sig=autocorrelate(sig,delay_start,delay_stop,normalization_mode)
|
tomwalters@0
|
26 if nargin==1
|
tomwalters@0
|
27 sig=crosscorrelate(sig,sig);
|
tomwalters@0
|
28 else if nargin==2
|
tomwalters@0
|
29 sig=crosscorrelate(sig,sig,delay_start);
|
tomwalters@0
|
30 else if nargin==3
|
tomwalters@0
|
31 sig=crosscorrelate(sig,sig,delay_start,delay_stop);
|
tomwalters@0
|
32 else if nargin==4
|
tomwalters@0
|
33 sig=crosscorrelate(sig,sig,delay_start,delay_stop,normalization_mode);
|
tomwalters@0
|
34 end
|
tomwalters@0
|
35 end
|
tomwalters@0
|
36 end
|
tomwalters@0
|
37 end |