各位前輩,我是才剛剛開始接觸DSP(digital sound processing)的學生,現在要用autocorrelation funtion 找出一個periodic signal 的周期,但是實在是不知道autocorrelation function 應該怎么用~~~比方說我得到一個sinusoidal signal(有噪音) 的ARF,怎樣才能根據ARF找出singal的周期呢~~~~~
回复 沙发 jameswangsynnex 的帖子
前辈的意思是~~~后生不太明白;)但是下边这段是我写的算ARF的code~~您看看吧~~
function [x]=Autocorrelation(a)
%function [x]=PitchDetection(a) is used to find the period of a singal
%input "a" is a given singal
%inpit "r" is the range of data of the given signal
%output "x" is the ACF (aotucorrelation function) of signal "a"
b=a;
m=1;
x=zeros(1,501);
for m=1:501
c=501;k=1;
for c=501:1001
x(m)=abs(a(c)-b(c-m+1))+x(m);
c=c+1;
end
x(m)=x(m)/501;
m=m+1;
end
检测信号可以是:a=sin(2*pi*t)+randn(1,1001)/1000;
在原siganl周期出现的地方ARF都接近于0,但是我不知道怎样通过ARF找到signal的周期~~~