Getting two components for one frequency in FFT

Hi,
I'm getting 2 freq in fft .
But I have signal at 1MHz. Getting peak at 999000 and next is at 1MHz.(other frequencies are also there , 10k, 50k, 500k. For these peak is same as signal frequency.)
Sampling freq is 5MPs.
What is happening at 1MHz ?
Any reason for this?
Please clarify this.
Thank you..

2 件のコメント

632541
632541 2021 年 4 月 21 日
Here is the code i have written .
Number of samples= 50000 samples.
fs=50000000; %Sampling frequency
nfft=length(m);
%nfft=2^nextpow2(nfft);
X=fft(m,nfft); %FFT of the signal
X=X(1:nfft/2);
%take magniutde
mx=abs(X);
f=(0:(nfft/2)-1)*fs/nfft; %Frequency range
figure(1);
n=50000;
t=0:1:(n-1);
plot(t,m);
title('Multisine')
xlabel('Samples')
ylabel('Amplitude');
figure(2)
plot(f,mx);
title('FFT of signal')
xlabel('Frequency')
ylabel('Amplitude');
632541
632541 2021 年 4 月 21 日
Any code alterations needed?
Or other solution?
Please provide your suggestions...

サインインしてコメントする。

 採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 4 月 21 日

1 投票

The fft is a circular Fourier transform, there will always be some spectral leakage from frequencies that are not exactly periodic over your data-sample-array. That is what you see here.
HTH

6 件のコメント

632541
632541 2021 年 4 月 21 日
But for other frequencies it is not.
How to overcome this?
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 4 月 21 日
This is nothing you can "overcome". First you have to understand why this happens in the first place. Plot your signal in time-domain and look at the last couple of samples and think about how periodic they are if continuing to the first few (that is the circular wrapping you're encountering), you can do this with single-frequency sine-signals to clearly see.
Then you can have a look at windowing your signal and the effects that have on your fft.
632541
632541 2021 年 4 月 21 日
Thank you.
Considering that i don't the frequency of the signal and want to find frequency of signal .
Now, do I consider 999000 or 1000000 Hz frequency ?
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 4 月 21 日
Yes, that is the approximate frequency-accuracy you will have.
After that you might try some old-fashioned curve-fitting with a few select harmonic terms using amplitudes (real and imaginary!) and the corresponding frequencies as start-guesses. That will be a far slower process than simply FFT-ing the data, but you might get away from the spectral leakage problem.
632541
632541 2021 年 4 月 21 日
Thanks Bjorn Gustavsson.
Will you please have a glance at code.
The input signal is discrete ,has 50000 samples.
like,m=[ 0 58 ..........]
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 4 月 21 日
Code looks OK, share the input signal for more detailed answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by