|
"Agus Nugroho" wrote in message <j7rjn2$ann$1@newscl01ah.mathworks.com>...
> Dear all,
>
> I would like to ask you if somebody can help me to check whats the problem in my sample signal.
>
> So lets say I have sample signal as below :
>
> ------------------------------------------------------------------------
>
> N=10000;
> T=1000;
> t=[0:N-1]/N;%interval time
> t=t*T;
> x1= 2*sin(2*pi*0.5*t)+5*sin(2*pi*0.2*t)+10*sin(2*pi*0.1*t)+20*sin(2*pi*0.05*t);
> x2= 5*sin(2*pi*0.2*t)+10*sin(2*pi*0.1*t);
>
> %mscohere function
>
> mscohere(x1,x2,hanning(512),256,512,100)
>
> _-------------------------------------------------------------------------
>
> As you can see, the coherence should points strong peak in frequency 0.2 and 0.1. However, the results that I got was not the same as it should be.
>
> Thank you for any explanation :)
>
> Regards,
>
> Agus
Hi Agus, The problem is that you have used the incorrect sampling frequency in mscohere().
Your sampling frequency is 10 Hz and you have entered 100 in your call to mscohere.
mscohere(x1,x2,hanning(512),256,512,10)
gives you what you expect.
Hope that helps,
Wayne
|