Mahaveer
Mahaveer

Reputation: 1

Compute FFT in frequency axis when signal is in rawData in Matlab

I have a signal of frequency 10 MHz sampled at 100 MS/sec. How to compute FFT in matlab in terms of frequency when my signal is in rawData (length of this rawData is 100000), also

  1. what should be the optimum length of NFFT.(i.e., on what factor does NFFT depend)
  2. why does my Amplitude (Y axis) change with NFFT
  3. whats difference between NFFT, N and L. How to compute length of a signal
  4. How to separate Noise and signal from a single signal (which is in rawData)

Here is my code,

t=(1:40);
f=10e6;
fs=100e6;

NFFT=1024;

y=abs(rawData(:1000,2));
X=abs(fft(y,NFFT));
f=[-fs/2:fs/NFFT:(fs/2-fs/NFFT)];

subplot(1,1,1);
semilogy(f(513:1024),X(513:1024));
axis([0 10e6 0 10]);

Upvotes: 0

Views: 281

Answers (1)

m7913d
m7913d

Reputation: 11072

As you can find the corresponding frequencies in another post, I will just answer your other questions:

  1. Including all your data is most of the time the best option. fft just truncates your input data to the requested length, which is probably not what you want. If you known the period of your input single, you can truncate it to include a whole number of periods. If you don't know it, a window (ex. Hanning) may be interesting.

  2. If you change NFFT, you use more data in your fft calculation, which may change the amplitude for a given frequency slightly. You also calculate the amplitude at more frequencies between 0 and Fs/2 (half of the sampling frequency).

  3. Question is not clear, please provide the definition of N and L.

  4. It depends on your application. If the noise is at the same frequency as your signal, you are not able to separate it. Otherwise, you can a filter (ex. bandpass) to extract the frequencies of interest.

Upvotes: 1

Related Questions