Whether there is any relationship between the frequency of an input signal and the frequency of it's fourier transform? For example, suppose I gave a 100Hz signal, whether my FFT frquency will also be 100 Hz?

  • 2
    $\begingroup$ What do you mean by "FFT frequency"? FFT converts between time or space domain and frequency domain. $\endgroup$ – Mike Dunlavey Aug 25 '15 at 18:04

Whether a 100 Hz input signal will show up as exactly 100 Hz in the FFT actually depends on the sampling frequency of your input, because the FFT is a discrete transform that operates on a finite number of samples. Because of this, the frequencies that appear in the FFT are necessarily multiples of the fundamental frequency $f_0$ which is

$$f_0 = \frac{1}{Nt_s}$$

where $N$ is the number of samples, and $t_s$ is the sample interval.

So if you take 1000 samples per second, and you sample for 1 second, the size of a frequency bin will be 1 Hz and the 100 Hz signal will fall exactly in a bin (bin # 101 - bin 0 is DC, bin 1 is 1 Hz, etc).

But if your sampling frequency is 1024 samples per second, a frequency bin will have a width of fundamental frequency will be 0.977 Hz and the 100 Hz signal will not fall exactly in one bin. Instead it will be spread over a number of adjacent bins (exactly how, depends on the windowing function you use).

So in general, the answer is "not necessarily". Although if you know the windowing function and you have the entire FFT spectrum, you can actually determine the frequency of the incoming signal - especially if you know that it is a single tone.

But the finite sampling of the FFT means that there is some uncertainty - and this is what you see most clearly when the sampling frequency is not a multiple of the source frequency.

Here is a simple demonstration (written in Python):

import numpy as np
import math
import matplotlib.pyplot as plt

Ns = 1024.0                 # number of samples
fs = 1000.0                 # sampling frequency
f = 100.0                   # "input" frequency
t = np.arange(0,Ns)/fs      # time when signal is sampled
fa = np.arange(0,Ns)*fs/Ns  # frequency bins
x = np.sin(2*f*math.pi*t)   # signal

f = np.fft.fft(x)           # perform FFT

plt.plot(fa,np.abs(f))      # plot curve
plt.xlabel('frequency')     # label axes
plt.xlim((90,110))          # zoom in a bit

When I run this script the graph I get looks like this:

enter image description here

So even though the input was "exactly" 100 Hz, the output does not show a peak at 100 Hz. Instead, the spectral power has been spread among several bins of the FFT.

A helpful post on the topic on the EE.SE

Link to the DSP stackexchange

| cite | improve this answer | |
  • $\begingroup$ Infact I saved my results in a pendrive from my oscilloscope and when i opened it I could see something like sample rate 625000. Are you talking about this rate? How can I get my set of frequencies from this? Actually Iam new to signal processing and I don't know much about these stuff. Can you kindly explain? $\endgroup$ – Rian Aug 25 '15 at 18:20
  • $\begingroup$ @Rian - see my example code (written before I saw your comment). It might help - but "signal processing" is a pretty big topic with an entire Stackexchange site devoted to it... $\endgroup$ – Floris Aug 25 '15 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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