Reputation: 1
I am new to Matlab and still getting to grips with FFT. I am currently working on a project where I have two cosine signals, both having a frequency of 100 Hz, but the second signal is delayed by a certain time - say 0.0030 seconds.
Knowing the frequency and the time delay, the expected phase difference between the two signals should be w*T
where T
is the time delay. To calculate the actual phase difference, I used the FFT function and had a look at the phase spectrum for both the signals.
For a time delay of 0.0030 seconds, the phase difference should be 108 degrees. When I use a sampling rate of 1000 Hz to sample the two cosine signals I see that the phase difference between the two signals is indeed 108 degrees, but when I use a sampling rate of 1024 Hz, the phase difference is 114 degrees.
For both the cases I used a frequency resolution of 1 Hz.
Can anybody tell me why there is this discrepancy?
Upvotes: 0
Views: 663
Reputation: 46365
When your sampling rate is an exact multiple of the frequency of the signal, your cosine signal falls exactly in one bin of the FFT. When you use 1024 samples per second the signal is spread across multiple bins (exactly how depends on the windowing function you used). This means the frequency for which you are determining the phase shift is not exactly 100 Hz...
Upvotes: 3