0

I have some misunderstanding in definition of frequency resolution of the signal. Here it is assumed that the resolution is: $$\hat{f_k}=f_{signal}\cdot T_{sampling}$$ (which is just relation of signal frequency to sampling frequency).

However, for example in the standard Python function for calculating frequency resolution of FFT, it is: $$\Delta f = \frac{f_{sampling}}{N}$$.

Why these definitions different?

Curious
  • 355
  • 1
  • 11
  • 1
    the wording "frequencies in frequency domain" indicates you're misunderstanding something. Do you maybe mean "relative frequencies" (in discrete) domain? – Marcus Müller Dec 01 '21 at 17:40
  • @MarcusMüller, sorry for this incorrect definition, I mean the list of frequencies, which we get for example, when we do Fourier transform. – Curious Dec 01 '21 at 17:55
  • 1
    this makes even less sense, because none of what you have in your question is a list, and the Fourier Transform (continuous-time) doesn't give you a list, either! The documentation of fftfreq is quite unambiguous, so I really don't understand how you can come to the conclusion that these are the same thing. Sorry, please edit your question to be 100% exactly what you mean. You say you have a misunderstanding problem, so being anything but pedantic with your own language will just lead to more misunderstandings. – Marcus Müller Dec 01 '21 at 18:05
  • @MarcusMüller, I tried my best) hope, now it is clear) – Curious Dec 01 '21 at 19:44
  • The first thing doesn't specify a resolution, as far as I can tell. You need to watch out for the context. This just seems to be, as said, a formula to convert a frequency of a time-continous signal to a relative frequency after sampling. – Marcus Müller Dec 01 '21 at 21:15
  • 1
    Does this answer your question? Specific Frequency Resolution – Dan Boschen Dec 01 '21 at 23:35
  • 1
    and this: https://dsp.stackexchange.com/questions/24685/how-to-calculate-resolution-of-dft-with-hamming-hann-window/51881#51881 – Dan Boschen Dec 01 '21 at 23:36
  • @DanBoschen, thank you for the links, they're really helped in my understanding! But I didn't get one point - why does the frequency resolution of the signal (as you wrote - block of data) is $1/T$, where $T$ is the total signal length (in my understanding the period is for something repeatable). I can derive it from the property "shorter signal has wider frequency spectrum while FFT", but it is not very evident for me. – Curious Dec 09 '21 at 13:07
  • @Curious please add your question in the comments below that specific post; I will answer there and update the posting as well if it was less clear. Thanks! – Dan Boschen Dec 09 '21 at 13:12
  • @DanBoschen, I wish I have enough reputation for this(( I mean this post. – Curious Dec 09 '21 at 13:16
  • @Curious Ok I gave you a answer below that I hope will clear this up for you together with those other details in the linked posts. – Dan Boschen Dec 09 '21 at 13:29

1 Answers1

2

A lot about frequency resolution and FFT's is revealed by understanding the correlation property of a frequency offset between two otherwise identical signals as demonstrated in the plots below. Here we see the results of correlating a 3 Hz tone sampled at 1 KHz with another tone at various frequencies, where here correlation is given as $\sum_{n=0}^{N-1}y[n]x^*[n]$. From this we see the universal take-away that is applicable to both analog and digital signals (such as the FFT) that the correlation is a Sinc function with the first null at $1/T$. This can also be explained by convolving the Fourier Transform of a rectangular window (which is effectively selecting the time block of data), which then extends to what occurs when we select the data with other windows (decreases the resolution as the Fourier Transform of the window ends up being wider in the main lobe than a Sinc function). However this most immediate view I give here, starting with really understanding correlation, I find to be most intuitive and far reaching across multiple applications in signal processing.

Given the relationship between sampling rate and $N$ in the DFT, the result that $\Delta F = F_s/N$ is identical to the conclusion here that $\Delta F$ is $1/T$ when $F$ is in units of Hz and $T$ is in units of seconds.

The plots below show the sampled cosine wave buried in a significant amount of noise, and showing how we can "pull the signal out of the noise" by using correlation techniques. This is exactly what the DFT (and more generally the Fourier Transform) does, and as such it allows us to determined the presences of each frequency (as given by $e^{jn \omega_k} = e^{j2\pi nk/N}$) in an arbitrary waveform. Observe the formula for the DFT and we see this same correlation expression I introduced above:

$$X[k] = \sum_{n=0}^{N-1}x[n]e^{-j2\pi nk/N}$$

1 second block of data

2 second block of data

Why do we lose correlation versus frequency offset? Consider the correlation process sample by sample, and frequency as a rotating phasor on the complex plane. When the two signals are at the same frequency, the complex conjugate multiplication in the correlation formula causes the resulting phasor from each product to be aligned as in the graphic below, and the resulting summation grows to a very large number (such as the scaling by $N$ in the DFT!):

Corr same freq

However if there is a slight frequency offset, the resulting phasors from each product will have an increasing rotation from sample to sample. When we are off in frequency by $1/T$, the total summation over that time will sum to 0!.

frequency offset

(Note that specifically in these plots the "3 Hz Tone" is $e^{j2\pi 3t}$ and the real portion of that is plotted as $\cos(2\pi 3 t)$. A correlation with $\cos(2\pi 3 t)$ would be similar but the discerning eye may notice the difference given the effect of the positive and negative frequency components of $\cos(2\pi 3 t)$. This detail is of little importance for most readers).

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135