0
$\begingroup$

I plotted a simple Cosine wave and After taking its FFT the frequency can be seen easily but after modifying the original signal to add more lower and higher frequencies, the higher ones are visible but the lower ones is not showing in the FFT plot,

Original Signal,

Amplitude = 4
x=A*cos(2*pi*f*n);

Frequency of Wave: 100Hz

Amplitude = 4

Sampling Frequency = 10000Hz

The 100Hz frequency (original signal frequency) is supposed to be plotted at point 1 of FFT, which is fine,

enter image description here

When adding another higher frequency into the original signal,

x= 1*cos(2*pi*500*n) + x ;

500HZ frequency is added into the original signal and supposed to be plotted at point 5 of the FFt.

Results in,

enter image description here

Which is fine, but when i am trying to add lower frequencies than higher they are not visible.

Adding 50Hz frequency to the original 100Hz Cosine wave,

what i think is 50Hz should be plotted at the 0.5 of the x-axis as it is half of the original frequency.

x= 1*cos(2*pi*50*n) + x ;

Results in,

enter image description here

Where is the 50Hz frequency ?

$\endgroup$
6
  • $\begingroup$ Have you tried plotting the 50 MHz tone all by itself? $\endgroup$
    – Jim Clay
    Oct 21, 2012 at 19:57
  • $\begingroup$ what command did you use to generate 'n'? $\endgroup$ Oct 22, 2012 at 1:03
  • $\begingroup$ @JimClay actually, it is 50Hz not 50MHz $\endgroup$ Oct 22, 2012 at 9:51
  • $\begingroup$ @geometrikal, it is, n=0:Ts:t $\endgroup$ Oct 22, 2012 at 9:51
  • $\begingroup$ What are your values for Ts and t $\endgroup$ Oct 23, 2012 at 4:19

1 Answer 1

5
$\begingroup$

What you're assuming about how FFT works is actually correct for Fourier transform, but – despite its name – FFT is not such a continuous all-$\mathbb{R}$ transformation. It is actually just a DFT, discrete Fourier transform, i.e. both the frequency and time spaces are quantised. In your example, you selected the quantisation in frequency space to be $100\:\mathrm{Hz}$, so there exists no $50\: \mathrm{Hz}$ bin.

$\endgroup$
4
  • $\begingroup$ That's true, but that doesn't mean that it won't show up at all. $\endgroup$
    – Jim Clay
    Oct 21, 2012 at 22:08
  • $\begingroup$ Indeed, and I'm surprised that it doesn't show up. In a properly designed DFT with overlapping windows it would be equally distributed between the 0th and 1st bin, in worse designs it might show up in just one of them plus a strong smear through the entire frequency spectrum. But I don't know what the OP used, so I can't say much more on this issue that would answer the question. $\endgroup$ Oct 21, 2012 at 22:32
  • $\begingroup$ @leftaroundabout Just curious, what do you mean by 'properly designed DFT with overlapping windows'? Are there different definitions? $\endgroup$ Oct 22, 2012 at 1:05
  • $\begingroup$ @geometrikal: actually, this isn't about the DFT itself but about the way you can use it to analyse a signal that's not periodic or compactly supported. If you just split such a signal in chunks without further ado, the sharply-cut borders will introduce artifacts that can be largely avoided by using window functions. $\endgroup$ Oct 22, 2012 at 1:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.