Clarification on defining FFT bin sizesArtifacts in FFTFFT frequency resolutionFFT Result - which bins are usefulHow can I decide proper FFT length(size)?Scale FFT frequency range for a bars graphDecreasing Sample Rate in DFT (FFT) for Audio AnalysisWhat should my reference value be when converting FFT bin amplitudes to dB?How to deal with the mirrored components of a FFT? And another questionInterpretation of FFT result when frequency is an exact multiple of frequency binThe DC bin of an FFT should be the mean of all the other bins in the spectrum, why does the FFT produce 0?

Why is a dedicated QA team member necessary?

How can I receive packages while in France?

What do I do when a student working in my lab "ghosts" me?

Is the apartment I want to rent a scam?

Is it normal practice to screen share with a client?

How to write a sincerely religious protagonist without preaching or affirming or judging their worldview?

How to optimize IN query on indexed column

Area of parallelogram = Area of square. Shear transform

Symbol of the tennis ball

Problem loading expl3 in plain TeX

Why did NASA use U.S customary units?

What are the exact meanings of roll, pitch and yaw?

What is "ass door"?

Why are there not any MRI machines available in Interstellar?

Why are so many countries still in the Commonwealth?

Company requiring me to let them review research from before I was hired

Is there a published campaign where a missing artifact or a relic is creating trouble by its absence?

Is Grandpa Irrational? Another Grandpa Mystery

What is the purpose of this "red room" in Stranger Things?

How to handle aversion that derives from perceiving arrogance?

Sitecore Powershell extensions module compatibility with Sitecore 9.2

Why are off grid solar setups only 12, 24, 48 VDC?

What was the rationale behind 36 bit computer architectures?

Why are angular mometum and angular velocity not necessarily parallel, but linear momentum and linear velocity are always parallel?



Clarification on defining FFT bin sizes


Artifacts in FFTFFT frequency resolutionFFT Result - which bins are usefulHow can I decide proper FFT length(size)?Scale FFT frequency range for a bars graphDecreasing Sample Rate in DFT (FFT) for Audio AnalysisWhat should my reference value be when converting FFT bin amplitudes to dB?How to deal with the mirrored components of a FFT? And another questionInterpretation of FFT result when frequency is an exact multiple of frequency binThe DC bin of an FFT should be the mean of all the other bins in the spectrum, why does the FFT produce 0?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2












$begingroup$


When reconstructing the frequency domain for an FFT, what is the most self-consistent way to do this -- i.e. how is it best to define the bin width, $Delta f$?



For example, previously I thought it a simple matter of saying,
$$Delta f = span / N_points,FFT$$ where the span is the size of the window you want to look at and $N_points,FFT$ is the number of points that should appear in the final FFT result. This makes very clear sense especially when you deal with some FFT spectrum analyzer where you set the span and the number of points in the final FFT (some times called the number of FFT lines) can also be set but tends to have some upper value for that device.



However I have also seen definitions attached to the sampling rate for the incoming transient signal to be FFT'd, as $$Delta f = f_sr / N_points,FFT$$ or even as $$Delta f = 2 f_sr / N_points,FFT$$ depending on how you define $N_points,FFT$. I.e. the number of points that goes into making the FFT or the number of points that will appear in the final FFT result because half the spectrum is thrown away due to mirroring.



Maybe it doesn't matter and it just depends on the way you choose to define things. But if anyone has any insight that would be helpful!




I am adding a little more to clarify my confusion.



Suppose you have some FFT spectrum analyzer that can process at maximum 2048 points in a time transient. That then means The final FFT would have 1024 points -- as we discard the mirror image. I then (again this is all in the context of making an FFT with some FFT spectrum analyzer device) say I want to set my span of this FFT to $50 rmHz$. This would give a resultant FFT with a bin width of $Delta f = 50 / 1024 = 0.049 rmHz$. To me this must imply that the sample rate, $f_sr$, must vary according to the desired span.



So is this is all question of what your free parameters are, whether the maximum number of points in a transient signal is fixed, or the maximum sample rate you can take, and so on?










share|improve this question











$endgroup$











  • $begingroup$
    I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:50


















2












$begingroup$


When reconstructing the frequency domain for an FFT, what is the most self-consistent way to do this -- i.e. how is it best to define the bin width, $Delta f$?



For example, previously I thought it a simple matter of saying,
$$Delta f = span / N_points,FFT$$ where the span is the size of the window you want to look at and $N_points,FFT$ is the number of points that should appear in the final FFT result. This makes very clear sense especially when you deal with some FFT spectrum analyzer where you set the span and the number of points in the final FFT (some times called the number of FFT lines) can also be set but tends to have some upper value for that device.



However I have also seen definitions attached to the sampling rate for the incoming transient signal to be FFT'd, as $$Delta f = f_sr / N_points,FFT$$ or even as $$Delta f = 2 f_sr / N_points,FFT$$ depending on how you define $N_points,FFT$. I.e. the number of points that goes into making the FFT or the number of points that will appear in the final FFT result because half the spectrum is thrown away due to mirroring.



Maybe it doesn't matter and it just depends on the way you choose to define things. But if anyone has any insight that would be helpful!




I am adding a little more to clarify my confusion.



Suppose you have some FFT spectrum analyzer that can process at maximum 2048 points in a time transient. That then means The final FFT would have 1024 points -- as we discard the mirror image. I then (again this is all in the context of making an FFT with some FFT spectrum analyzer device) say I want to set my span of this FFT to $50 rmHz$. This would give a resultant FFT with a bin width of $Delta f = 50 / 1024 = 0.049 rmHz$. To me this must imply that the sample rate, $f_sr$, must vary according to the desired span.



So is this is all question of what your free parameters are, whether the maximum number of points in a transient signal is fixed, or the maximum sample rate you can take, and so on?










share|improve this question











$endgroup$











  • $begingroup$
    I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:50














2












2








2


2



$begingroup$


When reconstructing the frequency domain for an FFT, what is the most self-consistent way to do this -- i.e. how is it best to define the bin width, $Delta f$?



For example, previously I thought it a simple matter of saying,
$$Delta f = span / N_points,FFT$$ where the span is the size of the window you want to look at and $N_points,FFT$ is the number of points that should appear in the final FFT result. This makes very clear sense especially when you deal with some FFT spectrum analyzer where you set the span and the number of points in the final FFT (some times called the number of FFT lines) can also be set but tends to have some upper value for that device.



However I have also seen definitions attached to the sampling rate for the incoming transient signal to be FFT'd, as $$Delta f = f_sr / N_points,FFT$$ or even as $$Delta f = 2 f_sr / N_points,FFT$$ depending on how you define $N_points,FFT$. I.e. the number of points that goes into making the FFT or the number of points that will appear in the final FFT result because half the spectrum is thrown away due to mirroring.



Maybe it doesn't matter and it just depends on the way you choose to define things. But if anyone has any insight that would be helpful!




I am adding a little more to clarify my confusion.



Suppose you have some FFT spectrum analyzer that can process at maximum 2048 points in a time transient. That then means The final FFT would have 1024 points -- as we discard the mirror image. I then (again this is all in the context of making an FFT with some FFT spectrum analyzer device) say I want to set my span of this FFT to $50 rmHz$. This would give a resultant FFT with a bin width of $Delta f = 50 / 1024 = 0.049 rmHz$. To me this must imply that the sample rate, $f_sr$, must vary according to the desired span.



So is this is all question of what your free parameters are, whether the maximum number of points in a transient signal is fixed, or the maximum sample rate you can take, and so on?










share|improve this question











$endgroup$




When reconstructing the frequency domain for an FFT, what is the most self-consistent way to do this -- i.e. how is it best to define the bin width, $Delta f$?



For example, previously I thought it a simple matter of saying,
$$Delta f = span / N_points,FFT$$ where the span is the size of the window you want to look at and $N_points,FFT$ is the number of points that should appear in the final FFT result. This makes very clear sense especially when you deal with some FFT spectrum analyzer where you set the span and the number of points in the final FFT (some times called the number of FFT lines) can also be set but tends to have some upper value for that device.



However I have also seen definitions attached to the sampling rate for the incoming transient signal to be FFT'd, as $$Delta f = f_sr / N_points,FFT$$ or even as $$Delta f = 2 f_sr / N_points,FFT$$ depending on how you define $N_points,FFT$. I.e. the number of points that goes into making the FFT or the number of points that will appear in the final FFT result because half the spectrum is thrown away due to mirroring.



Maybe it doesn't matter and it just depends on the way you choose to define things. But if anyone has any insight that would be helpful!




I am adding a little more to clarify my confusion.



Suppose you have some FFT spectrum analyzer that can process at maximum 2048 points in a time transient. That then means The final FFT would have 1024 points -- as we discard the mirror image. I then (again this is all in the context of making an FFT with some FFT spectrum analyzer device) say I want to set my span of this FFT to $50 rmHz$. This would give a resultant FFT with a bin width of $Delta f = 50 / 1024 = 0.049 rmHz$. To me this must imply that the sample rate, $f_sr$, must vary according to the desired span.



So is this is all question of what your free parameters are, whether the maximum number of points in a transient signal is fixed, or the maximum sample rate you can take, and so on?







fft dft






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 15 at 13:29







QuantumPenguin

















asked Jul 15 at 12:06









QuantumPenguinQuantumPenguin

1396 bronze badges




1396 bronze badges











  • $begingroup$
    I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:50

















  • $begingroup$
    I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:50
















$begingroup$
I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
$endgroup$
– Cedron Dawg
Jul 15 at 13:50





$begingroup$
I appended my answer before I saw your clarification. It should answer your questions. I would recommend that you use "point" for your sample values and "bin" for your DFT values. A "DFT point" is misleading. Typically you set two parameters, the sampling rate and the sampling interval (frame), everything else gets set from those. Longer intervals give you bigger "bin spacing" and thus higher resolution (the ability to distinguish tones). Higher sampling rates don't improve resolution, but they do increase the frequency range before aliasing occurs.
$endgroup$
– Cedron Dawg
Jul 15 at 13:50











6 Answers
6






active

oldest

votes


















3












$begingroup$

I don't think Hilmar's answer is very good as it interprets the DFT within a specific application context. That confuses issues.



The DFT is a tranform that works on a set of N samples. The samples are presumed to be evenly spaced in their domain on a finite interval of samples is called a frame. It may be time, it may be distance, or it could even be another dimension. The bin values tell you how close your samples are to corresponding to that bin. The important thing to remember is each bin corresponds to a sinusoidal which has a frequency of the bin index measured in units of cycles per frame. What happens outside the frame is out of scope for the DFT. Saying "The DFT assumes the interval is infinitely repeating" is misleading without any constructive benefit. What is true is that an inverse DFT can be extended, and it will form a repeating pattern.



The concept of "energy" is only valid is a subset of applications. "Leakage" is not about energy at all, it is about representation of points in multidimensional coordinate systems. But that discussion is a bit mathematical.



What it seems you are stuggling with having to do with definitions on particular applications and what is the significance of the number of sample points on your frequency values and the possible resolutions. Those concepts are straightforward with a understanding of the DFT devoid of application details.



Suppose you have a given signal over a fixed interval. If that signal has three cycles in the frame, the parameters of the fundamental will be found in bin 3 (zero based indexing), and its harmonics will be in bin 6, 9, 12, etc. The number of sample points you use will determine the number of bins there are. The more bins there are the higher up your halfway point (called Nyquist) is. If the frequency of your signal (or one of its harmonics) exceeds the Nyquist value, then it will "wrap around" and look like a different frequency. This is called an alias.



For instance, suppose you had N=16. Then the Nyquist bin is 8. A signal will 10 cycles per frame will land in bin 10, but its mirror image value lands in bin 6, so if you are looking at the DFT you would say, "Hey there is a 6 cycles per frame signal in there", when in fact it is 10. Increasing your sample count would fix that. For N=32, the 10 bin would still have a value, but now the mirror image is in 22. That's why you have to sample at least twice the rate of the highest frequency you want to find to have it land in the lower half.



BTW, every DFT is exact, aka lossless.




The sampling rate is what ties the units of the DFT to the units of your application. N has units of samples per frame. $f_s$ is the conventional symbol for samples per application unit, usually seconds, so the unit is samples per second, designated with Hz. This is a little misleading as the sampling is better thought of as a rate instead of a frequency. Anyway, using T for your interval length, measured in seconds, you have.



$$ f_s left(fracsamplessecondright) = frac N left(fracsamplesframeright) T left(fracsecondsframeright) $$



Of course, you can switch that around, say:



$$ N = f_s cdot T $$



To interpret the bin values, $k$ is usually used for the bin index, so the frequency associated with a bin is $k$ cycles per frame. Hence:



$$ frac k left(fraccyclesframeright) T left(fracsecondsframeright) = k/T left(fraccyclessecondright) $$



Therefore the "bin spacing", i.e. the difference in frequency between two adjacent bins, is $1/T$, but the units are still cycles per second.



Now, from above, $ T = N / f_s $, so the bin spacing can also be called $ f_s / N $.




And just a bit more insight...



Your Nyquist frequency is always going to be 2 samples per cycle for any N.



$$ frac 2pi left(fracradianscycleright) 2 left(fracsamplescycleright) = pi left(fracradianssampleright) $$



It is also helpful to picture the DFT bins arranged around the unit circle in the complex plane. The DC bin on the 1, and the Nyquist is on the -1. The Nyquist is the same distance from the DC whether you go clockwise or counter-clockwise. The bins are indexed from 0 to N/2 across the top for even N, and 0 to (N-1)/2 for odd N. There is only a Nyquist bin for even N. The bottom half is better indexed with negative values($-k$), but usually comes back as the upper part of the results($N-k$). The definition doesn't care and they are aliases.



The mirror image, aka conjugate symmetry, is only true for real valued signals. Ultimately it works the way it does because:



$$ cos( theta ) = frac e^itheta + e^-itheta 2 $$



But that's a longer story.






share|improve this answer











$endgroup$












  • $begingroup$
    okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
    $endgroup$
    – QuantumPenguin
    Jul 15 at 13:21










  • $begingroup$
    @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:43










  • $begingroup$
    Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
    $endgroup$
    – QuantumPenguin
    Jul 15 at 16:18






  • 2




    $begingroup$
    @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 16:48






  • 2




    $begingroup$
    @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 17:00


















5












$begingroup$

Let's assume we have a sample rate of $f_s=10 kHz$ and FFT size of $N=1000$



  1. Your bin spacing is $delta f = 10 Hz$. It's simply the sample rate divided by the FFT size. That's all there is to it.

  2. Keep in mind that the FFT requires both the time domain and the frequency domain signal to be perodic. Most signals are not, so there needs to be some sort "accommodation" that's specific to the needs for your application.

  3. A real-valued sine wave with a frequency that is an integer multiple of the bin spacing will only show up in two bins symmetric around zero. I.e. a 100 Hz sine wave will show up in bins +10 and -10 (assuming we index the bins from $[-N/2,N/2-1]$

  4. A complex exponential with a frequency that is integer multiple of the bin spacing will only show up in one bin. I.e. a +100 Hz complex exponential will show up bin +10.

  5. A cosine wave with a frequency that's NOT an integer multiple of the bin spacing (e.g. 105Hz) will spread out over all bins. The bulk of the energy will be in the neighborhood of 105 Hz but there will be energy in ALL bins. This is a direct consequence of bullet 2): the FFT assumes periodicity with $N/f_s$. In essence the FFT doesn't calculate the spectrum of the sine wave, but the spectrum of a signal that consists of 1000 sample long snippet of a 105Hz cosine that gets repeated infinite times. At the splice point there is a massive discontinuity and that causes the energy to spread over all bands

  6. In order to minimize this spreading effect, one can apply a window, that tapers down the edges of the time domain frame and reduces the discontinuity. On the other hand, the window also smears out the energy in the frequency domain, so you can't get any sharp lines any more.

  7. Many people think that the FFT will give you an "exact" representation of the signal's frequency content. That's not the case unless the time domain signal is either periodic with the FFT length or if it's finite in time. For all other signals the results will depend heavily on the exact process and parameters chosen.

EDIT: reworded item 7 per the comment






share|improve this answer











$endgroup$












  • $begingroup$
    Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
    $endgroup$
    – QuantumPenguin
    Jul 15 at 12:55











  • $begingroup$
    Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 13:13







  • 1




    $begingroup$
    @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
    $endgroup$
    – Hilmar
    Jul 15 at 15:50










  • $begingroup$
    @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
    $endgroup$
    – Hilmar
    Jul 15 at 15:53










  • $begingroup$
    @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
    $endgroup$
    – QuantumPenguin
    Jul 15 at 16:03


















2












$begingroup$

FFT result bin spacing is proportional to sample rate and inversely proportional to the length of the FFT. Any two of the three (deltaF, SRate, N) can be independant parameters (within the range your equipment allows). That will determine the third. e.g. the maximum range of the two free variables in your spectrum analyzer settings will determine the maximum range of the third dependent variable.



You have to sample longer (or use samples from a longer window) to tell closer spaced frequency spectra apart. You can't tell a 440 Hz note "A" from a 441 Hz note in fast music. But with a constant concert-A tone for a minute, you can just count the zero crossings in a waveform plot, and see a clear difference of over 100 more zero crossings. Either a longer FFT, or wider bin spacing due to less samples used. And you have to sample faster if you want to see faster changing input (higher maximum frequencies). A higher sample rate.






share|improve this answer











$endgroup$












  • $begingroup$
    You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 21:19











  • $begingroup$
    The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
    $endgroup$
    – hotpaw2
    Jul 15 at 22:18











  • $begingroup$
    @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
    $endgroup$
    – Cedron Dawg
    Jul 15 at 22:43


















2












$begingroup$

Your confusion is very much understandable because it took me a while to understand the frequency axis spacing issue. Finally after digging for years, I found that your question is answered by the theorem of Cooley (the man who made FT possible on computers) in 1967. It is sad that no textbook addresses this as a theorem but casually mentions in passing.



More details here: https://chemistry.stackexchange.com/questions/117901/zero-filling-fourier-transform-in-nmr/117919#117919



The frequency axis spacing issue is a result of a beautiful theorem. I found in Cooley's original paper from 1967 [1, p. 80].




Theorem 1



If $x(t), -∞ < t < ∞,$ and $a(f), -∞ < f < ∞,$ are a Fourier integral transform pair,



$$x(t) ↔ a(f),$$



then $Tx_p(jΔt), j = 0, 1, cdots, N - 1,$ and $a_p(nΔf), n = 0, 1, 2, cdots, N - 1,$ are a finite Fourier transform pair,



$$
beginalign
Tx_p(jΔt) &= Tsum_l = -∞^∞x(jΔt + lT) ↔ sum_k = -∞^∞a(nΔf + kF) \
&= a_p(nΔf)
endalign
$$



where $Δf = 1/(NΔt) = 1/T.$



It is to be remembered that the finite Fourier transform pair



$$X(j) ↔ A(n)$$



is defined by



$$X(j) = sum_n = 0^N - 1A(n)W_N^jn, quad W_N = e^2πi/N$$



Thus, if two functions are Fourier transforms of one another, then the sequences obtained from them by aliasing and sampling in this fashion are finite Fourier transforms of one another.




Cooley & Tukey are the key persons who made Discrete Fourier Transform (DFT) possible by computers for lowly mortals like us, otherwise it was an elitist subject among the mathematicians. However, math researchers told me this was known in 1754. Full discussion here: History of Integral Transform Theorem



References



  1. Cooley, J.; Lewis, P.; Welch, P. Application of the Fast Fourier Transform to Computation of Fourier Integrals, Fourier Series, and Convolution Integrals. IEEE Transactions on Audio and Electroacoustics 1967, 15 (2), 79–84. https://doi.org/10/bmw8z8.





share|improve this answer











$endgroup$












  • $begingroup$
    Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
    $endgroup$
    – QuantumPenguin
    Jul 15 at 16:04










  • $begingroup$
    The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
    $endgroup$
    – M. Farooq
    Jul 15 at 16:55



















0












$begingroup$

In a real spectrum analyzer the input sample rate may be wider than the pass band of the upstream filters. After the FFT, only the frequencies in the passband of the filter are shown in the span. So the first equation you showed is for you don't crop anything in the frequency domain, the other equations are more general.



Also real spectrum analyzers will apply a window function to the time domain to give the frequency domain a nice shape this typically makes the actual resolution bandwidth several bins wide, so the FFT bin spacing is not as relevant.






share|improve this answer









$endgroup$




















    0












    $begingroup$

    Just a quick note, thanks to all for the contributions. Together you helped me understand my problem. Essentially what we can say is that the size of the final FFT window or the span, is simply $$span = Delta f left( fracN_s2 - 1 right)$$ or in context of the sample frequency, $f_s$, $$ span = f_s left( frac12 - frac1N_s right)$$. Where $N_s$ is the number of samples to be FFT's ($N_s / 2$ is the number of points left in the final FFT result as we throw half away because of mirroring), and $Delta f = f_s / N_s$ is the line width resolution.



    $1/Delta_f$ is the amount of time required to take a transient signal due to the Fourier limit.






    share|improve this answer









    $endgroup$















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "295"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdsp.stackexchange.com%2fquestions%2f59519%2fclarification-on-defining-fft-bin-sizes%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      6 Answers
      6






      active

      oldest

      votes








      6 Answers
      6






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3












      $begingroup$

      I don't think Hilmar's answer is very good as it interprets the DFT within a specific application context. That confuses issues.



      The DFT is a tranform that works on a set of N samples. The samples are presumed to be evenly spaced in their domain on a finite interval of samples is called a frame. It may be time, it may be distance, or it could even be another dimension. The bin values tell you how close your samples are to corresponding to that bin. The important thing to remember is each bin corresponds to a sinusoidal which has a frequency of the bin index measured in units of cycles per frame. What happens outside the frame is out of scope for the DFT. Saying "The DFT assumes the interval is infinitely repeating" is misleading without any constructive benefit. What is true is that an inverse DFT can be extended, and it will form a repeating pattern.



      The concept of "energy" is only valid is a subset of applications. "Leakage" is not about energy at all, it is about representation of points in multidimensional coordinate systems. But that discussion is a bit mathematical.



      What it seems you are stuggling with having to do with definitions on particular applications and what is the significance of the number of sample points on your frequency values and the possible resolutions. Those concepts are straightforward with a understanding of the DFT devoid of application details.



      Suppose you have a given signal over a fixed interval. If that signal has three cycles in the frame, the parameters of the fundamental will be found in bin 3 (zero based indexing), and its harmonics will be in bin 6, 9, 12, etc. The number of sample points you use will determine the number of bins there are. The more bins there are the higher up your halfway point (called Nyquist) is. If the frequency of your signal (or one of its harmonics) exceeds the Nyquist value, then it will "wrap around" and look like a different frequency. This is called an alias.



      For instance, suppose you had N=16. Then the Nyquist bin is 8. A signal will 10 cycles per frame will land in bin 10, but its mirror image value lands in bin 6, so if you are looking at the DFT you would say, "Hey there is a 6 cycles per frame signal in there", when in fact it is 10. Increasing your sample count would fix that. For N=32, the 10 bin would still have a value, but now the mirror image is in 22. That's why you have to sample at least twice the rate of the highest frequency you want to find to have it land in the lower half.



      BTW, every DFT is exact, aka lossless.




      The sampling rate is what ties the units of the DFT to the units of your application. N has units of samples per frame. $f_s$ is the conventional symbol for samples per application unit, usually seconds, so the unit is samples per second, designated with Hz. This is a little misleading as the sampling is better thought of as a rate instead of a frequency. Anyway, using T for your interval length, measured in seconds, you have.



      $$ f_s left(fracsamplessecondright) = frac N left(fracsamplesframeright) T left(fracsecondsframeright) $$



      Of course, you can switch that around, say:



      $$ N = f_s cdot T $$



      To interpret the bin values, $k$ is usually used for the bin index, so the frequency associated with a bin is $k$ cycles per frame. Hence:



      $$ frac k left(fraccyclesframeright) T left(fracsecondsframeright) = k/T left(fraccyclessecondright) $$



      Therefore the "bin spacing", i.e. the difference in frequency between two adjacent bins, is $1/T$, but the units are still cycles per second.



      Now, from above, $ T = N / f_s $, so the bin spacing can also be called $ f_s / N $.




      And just a bit more insight...



      Your Nyquist frequency is always going to be 2 samples per cycle for any N.



      $$ frac 2pi left(fracradianscycleright) 2 left(fracsamplescycleright) = pi left(fracradianssampleright) $$



      It is also helpful to picture the DFT bins arranged around the unit circle in the complex plane. The DC bin on the 1, and the Nyquist is on the -1. The Nyquist is the same distance from the DC whether you go clockwise or counter-clockwise. The bins are indexed from 0 to N/2 across the top for even N, and 0 to (N-1)/2 for odd N. There is only a Nyquist bin for even N. The bottom half is better indexed with negative values($-k$), but usually comes back as the upper part of the results($N-k$). The definition doesn't care and they are aliases.



      The mirror image, aka conjugate symmetry, is only true for real valued signals. Ultimately it works the way it does because:



      $$ cos( theta ) = frac e^itheta + e^-itheta 2 $$



      But that's a longer story.






      share|improve this answer











      $endgroup$












      • $begingroup$
        okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 13:21










      • $begingroup$
        @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:43










      • $begingroup$
        Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:18






      • 2




        $begingroup$
        @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 16:48






      • 2




        $begingroup$
        @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 17:00















      3












      $begingroup$

      I don't think Hilmar's answer is very good as it interprets the DFT within a specific application context. That confuses issues.



      The DFT is a tranform that works on a set of N samples. The samples are presumed to be evenly spaced in their domain on a finite interval of samples is called a frame. It may be time, it may be distance, or it could even be another dimension. The bin values tell you how close your samples are to corresponding to that bin. The important thing to remember is each bin corresponds to a sinusoidal which has a frequency of the bin index measured in units of cycles per frame. What happens outside the frame is out of scope for the DFT. Saying "The DFT assumes the interval is infinitely repeating" is misleading without any constructive benefit. What is true is that an inverse DFT can be extended, and it will form a repeating pattern.



      The concept of "energy" is only valid is a subset of applications. "Leakage" is not about energy at all, it is about representation of points in multidimensional coordinate systems. But that discussion is a bit mathematical.



      What it seems you are stuggling with having to do with definitions on particular applications and what is the significance of the number of sample points on your frequency values and the possible resolutions. Those concepts are straightforward with a understanding of the DFT devoid of application details.



      Suppose you have a given signal over a fixed interval. If that signal has three cycles in the frame, the parameters of the fundamental will be found in bin 3 (zero based indexing), and its harmonics will be in bin 6, 9, 12, etc. The number of sample points you use will determine the number of bins there are. The more bins there are the higher up your halfway point (called Nyquist) is. If the frequency of your signal (or one of its harmonics) exceeds the Nyquist value, then it will "wrap around" and look like a different frequency. This is called an alias.



      For instance, suppose you had N=16. Then the Nyquist bin is 8. A signal will 10 cycles per frame will land in bin 10, but its mirror image value lands in bin 6, so if you are looking at the DFT you would say, "Hey there is a 6 cycles per frame signal in there", when in fact it is 10. Increasing your sample count would fix that. For N=32, the 10 bin would still have a value, but now the mirror image is in 22. That's why you have to sample at least twice the rate of the highest frequency you want to find to have it land in the lower half.



      BTW, every DFT is exact, aka lossless.




      The sampling rate is what ties the units of the DFT to the units of your application. N has units of samples per frame. $f_s$ is the conventional symbol for samples per application unit, usually seconds, so the unit is samples per second, designated with Hz. This is a little misleading as the sampling is better thought of as a rate instead of a frequency. Anyway, using T for your interval length, measured in seconds, you have.



      $$ f_s left(fracsamplessecondright) = frac N left(fracsamplesframeright) T left(fracsecondsframeright) $$



      Of course, you can switch that around, say:



      $$ N = f_s cdot T $$



      To interpret the bin values, $k$ is usually used for the bin index, so the frequency associated with a bin is $k$ cycles per frame. Hence:



      $$ frac k left(fraccyclesframeright) T left(fracsecondsframeright) = k/T left(fraccyclessecondright) $$



      Therefore the "bin spacing", i.e. the difference in frequency between two adjacent bins, is $1/T$, but the units are still cycles per second.



      Now, from above, $ T = N / f_s $, so the bin spacing can also be called $ f_s / N $.




      And just a bit more insight...



      Your Nyquist frequency is always going to be 2 samples per cycle for any N.



      $$ frac 2pi left(fracradianscycleright) 2 left(fracsamplescycleright) = pi left(fracradianssampleright) $$



      It is also helpful to picture the DFT bins arranged around the unit circle in the complex plane. The DC bin on the 1, and the Nyquist is on the -1. The Nyquist is the same distance from the DC whether you go clockwise or counter-clockwise. The bins are indexed from 0 to N/2 across the top for even N, and 0 to (N-1)/2 for odd N. There is only a Nyquist bin for even N. The bottom half is better indexed with negative values($-k$), but usually comes back as the upper part of the results($N-k$). The definition doesn't care and they are aliases.



      The mirror image, aka conjugate symmetry, is only true for real valued signals. Ultimately it works the way it does because:



      $$ cos( theta ) = frac e^itheta + e^-itheta 2 $$



      But that's a longer story.






      share|improve this answer











      $endgroup$












      • $begingroup$
        okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 13:21










      • $begingroup$
        @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:43










      • $begingroup$
        Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:18






      • 2




        $begingroup$
        @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 16:48






      • 2




        $begingroup$
        @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 17:00













      3












      3








      3





      $begingroup$

      I don't think Hilmar's answer is very good as it interprets the DFT within a specific application context. That confuses issues.



      The DFT is a tranform that works on a set of N samples. The samples are presumed to be evenly spaced in their domain on a finite interval of samples is called a frame. It may be time, it may be distance, or it could even be another dimension. The bin values tell you how close your samples are to corresponding to that bin. The important thing to remember is each bin corresponds to a sinusoidal which has a frequency of the bin index measured in units of cycles per frame. What happens outside the frame is out of scope for the DFT. Saying "The DFT assumes the interval is infinitely repeating" is misleading without any constructive benefit. What is true is that an inverse DFT can be extended, and it will form a repeating pattern.



      The concept of "energy" is only valid is a subset of applications. "Leakage" is not about energy at all, it is about representation of points in multidimensional coordinate systems. But that discussion is a bit mathematical.



      What it seems you are stuggling with having to do with definitions on particular applications and what is the significance of the number of sample points on your frequency values and the possible resolutions. Those concepts are straightforward with a understanding of the DFT devoid of application details.



      Suppose you have a given signal over a fixed interval. If that signal has three cycles in the frame, the parameters of the fundamental will be found in bin 3 (zero based indexing), and its harmonics will be in bin 6, 9, 12, etc. The number of sample points you use will determine the number of bins there are. The more bins there are the higher up your halfway point (called Nyquist) is. If the frequency of your signal (or one of its harmonics) exceeds the Nyquist value, then it will "wrap around" and look like a different frequency. This is called an alias.



      For instance, suppose you had N=16. Then the Nyquist bin is 8. A signal will 10 cycles per frame will land in bin 10, but its mirror image value lands in bin 6, so if you are looking at the DFT you would say, "Hey there is a 6 cycles per frame signal in there", when in fact it is 10. Increasing your sample count would fix that. For N=32, the 10 bin would still have a value, but now the mirror image is in 22. That's why you have to sample at least twice the rate of the highest frequency you want to find to have it land in the lower half.



      BTW, every DFT is exact, aka lossless.




      The sampling rate is what ties the units of the DFT to the units of your application. N has units of samples per frame. $f_s$ is the conventional symbol for samples per application unit, usually seconds, so the unit is samples per second, designated with Hz. This is a little misleading as the sampling is better thought of as a rate instead of a frequency. Anyway, using T for your interval length, measured in seconds, you have.



      $$ f_s left(fracsamplessecondright) = frac N left(fracsamplesframeright) T left(fracsecondsframeright) $$



      Of course, you can switch that around, say:



      $$ N = f_s cdot T $$



      To interpret the bin values, $k$ is usually used for the bin index, so the frequency associated with a bin is $k$ cycles per frame. Hence:



      $$ frac k left(fraccyclesframeright) T left(fracsecondsframeright) = k/T left(fraccyclessecondright) $$



      Therefore the "bin spacing", i.e. the difference in frequency between two adjacent bins, is $1/T$, but the units are still cycles per second.



      Now, from above, $ T = N / f_s $, so the bin spacing can also be called $ f_s / N $.




      And just a bit more insight...



      Your Nyquist frequency is always going to be 2 samples per cycle for any N.



      $$ frac 2pi left(fracradianscycleright) 2 left(fracsamplescycleright) = pi left(fracradianssampleright) $$



      It is also helpful to picture the DFT bins arranged around the unit circle in the complex plane. The DC bin on the 1, and the Nyquist is on the -1. The Nyquist is the same distance from the DC whether you go clockwise or counter-clockwise. The bins are indexed from 0 to N/2 across the top for even N, and 0 to (N-1)/2 for odd N. There is only a Nyquist bin for even N. The bottom half is better indexed with negative values($-k$), but usually comes back as the upper part of the results($N-k$). The definition doesn't care and they are aliases.



      The mirror image, aka conjugate symmetry, is only true for real valued signals. Ultimately it works the way it does because:



      $$ cos( theta ) = frac e^itheta + e^-itheta 2 $$



      But that's a longer story.






      share|improve this answer











      $endgroup$



      I don't think Hilmar's answer is very good as it interprets the DFT within a specific application context. That confuses issues.



      The DFT is a tranform that works on a set of N samples. The samples are presumed to be evenly spaced in their domain on a finite interval of samples is called a frame. It may be time, it may be distance, or it could even be another dimension. The bin values tell you how close your samples are to corresponding to that bin. The important thing to remember is each bin corresponds to a sinusoidal which has a frequency of the bin index measured in units of cycles per frame. What happens outside the frame is out of scope for the DFT. Saying "The DFT assumes the interval is infinitely repeating" is misleading without any constructive benefit. What is true is that an inverse DFT can be extended, and it will form a repeating pattern.



      The concept of "energy" is only valid is a subset of applications. "Leakage" is not about energy at all, it is about representation of points in multidimensional coordinate systems. But that discussion is a bit mathematical.



      What it seems you are stuggling with having to do with definitions on particular applications and what is the significance of the number of sample points on your frequency values and the possible resolutions. Those concepts are straightforward with a understanding of the DFT devoid of application details.



      Suppose you have a given signal over a fixed interval. If that signal has three cycles in the frame, the parameters of the fundamental will be found in bin 3 (zero based indexing), and its harmonics will be in bin 6, 9, 12, etc. The number of sample points you use will determine the number of bins there are. The more bins there are the higher up your halfway point (called Nyquist) is. If the frequency of your signal (or one of its harmonics) exceeds the Nyquist value, then it will "wrap around" and look like a different frequency. This is called an alias.



      For instance, suppose you had N=16. Then the Nyquist bin is 8. A signal will 10 cycles per frame will land in bin 10, but its mirror image value lands in bin 6, so if you are looking at the DFT you would say, "Hey there is a 6 cycles per frame signal in there", when in fact it is 10. Increasing your sample count would fix that. For N=32, the 10 bin would still have a value, but now the mirror image is in 22. That's why you have to sample at least twice the rate of the highest frequency you want to find to have it land in the lower half.



      BTW, every DFT is exact, aka lossless.




      The sampling rate is what ties the units of the DFT to the units of your application. N has units of samples per frame. $f_s$ is the conventional symbol for samples per application unit, usually seconds, so the unit is samples per second, designated with Hz. This is a little misleading as the sampling is better thought of as a rate instead of a frequency. Anyway, using T for your interval length, measured in seconds, you have.



      $$ f_s left(fracsamplessecondright) = frac N left(fracsamplesframeright) T left(fracsecondsframeright) $$



      Of course, you can switch that around, say:



      $$ N = f_s cdot T $$



      To interpret the bin values, $k$ is usually used for the bin index, so the frequency associated with a bin is $k$ cycles per frame. Hence:



      $$ frac k left(fraccyclesframeright) T left(fracsecondsframeright) = k/T left(fraccyclessecondright) $$



      Therefore the "bin spacing", i.e. the difference in frequency between two adjacent bins, is $1/T$, but the units are still cycles per second.



      Now, from above, $ T = N / f_s $, so the bin spacing can also be called $ f_s / N $.




      And just a bit more insight...



      Your Nyquist frequency is always going to be 2 samples per cycle for any N.



      $$ frac 2pi left(fracradianscycleright) 2 left(fracsamplescycleright) = pi left(fracradianssampleright) $$



      It is also helpful to picture the DFT bins arranged around the unit circle in the complex plane. The DC bin on the 1, and the Nyquist is on the -1. The Nyquist is the same distance from the DC whether you go clockwise or counter-clockwise. The bins are indexed from 0 to N/2 across the top for even N, and 0 to (N-1)/2 for odd N. There is only a Nyquist bin for even N. The bottom half is better indexed with negative values($-k$), but usually comes back as the upper part of the results($N-k$). The definition doesn't care and they are aliases.



      The mirror image, aka conjugate symmetry, is only true for real valued signals. Ultimately it works the way it does because:



      $$ cos( theta ) = frac e^itheta + e^-itheta 2 $$



      But that's a longer story.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 15 at 15:27

























      answered Jul 15 at 13:10









      Cedron DawgCedron Dawg

      3,7802 gold badges3 silver badges12 bronze badges




      3,7802 gold badges3 silver badges12 bronze badges











      • $begingroup$
        okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 13:21










      • $begingroup$
        @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:43










      • $begingroup$
        Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:18






      • 2




        $begingroup$
        @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 16:48






      • 2




        $begingroup$
        @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 17:00
















      • $begingroup$
        okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 13:21










      • $begingroup$
        @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:43










      • $begingroup$
        Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:18






      • 2




        $begingroup$
        @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 16:48






      • 2




        $begingroup$
        @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 17:00















      $begingroup$
      okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
      $endgroup$
      – QuantumPenguin
      Jul 15 at 13:21




      $begingroup$
      okay now this is a much better answer and is getting closer to what I am trying to understand. I still feel there is somehow an intrinsic relation between the span of an FFT and the sampling rate. I'm going to add a bit more in my question if you don't mind taking a look?
      $endgroup$
      – QuantumPenguin
      Jul 15 at 13:21












      $begingroup$
      @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 13:43




      $begingroup$
      @QuantumPenguin, I've updated my answer for you. You might also want to check out dsprelated.com/showarticle/768.php for a "physical meaning" of the bin values.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 13:43












      $begingroup$
      Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:18




      $begingroup$
      Thanks for expanding on your answer! Also nice discussions in the link you provide. Really the last piece for me is to somehow relate, or show the interconnection of the span and the sample rate.
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:18




      2




      2




      $begingroup$
      @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 16:48




      $begingroup$
      @QuantumPenguin The frame is the span, or perhaps better said: The DFT frame covers a span. The sample rate is independent. It is the conversion factor between the length of your span and the sample count N.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 16:48




      2




      2




      $begingroup$
      @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 17:00




      $begingroup$
      @QuantumPenguin Sample rate, span length, or sample count? You get to choose 2.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 17:00













      5












      $begingroup$

      Let's assume we have a sample rate of $f_s=10 kHz$ and FFT size of $N=1000$



      1. Your bin spacing is $delta f = 10 Hz$. It's simply the sample rate divided by the FFT size. That's all there is to it.

      2. Keep in mind that the FFT requires both the time domain and the frequency domain signal to be perodic. Most signals are not, so there needs to be some sort "accommodation" that's specific to the needs for your application.

      3. A real-valued sine wave with a frequency that is an integer multiple of the bin spacing will only show up in two bins symmetric around zero. I.e. a 100 Hz sine wave will show up in bins +10 and -10 (assuming we index the bins from $[-N/2,N/2-1]$

      4. A complex exponential with a frequency that is integer multiple of the bin spacing will only show up in one bin. I.e. a +100 Hz complex exponential will show up bin +10.

      5. A cosine wave with a frequency that's NOT an integer multiple of the bin spacing (e.g. 105Hz) will spread out over all bins. The bulk of the energy will be in the neighborhood of 105 Hz but there will be energy in ALL bins. This is a direct consequence of bullet 2): the FFT assumes periodicity with $N/f_s$. In essence the FFT doesn't calculate the spectrum of the sine wave, but the spectrum of a signal that consists of 1000 sample long snippet of a 105Hz cosine that gets repeated infinite times. At the splice point there is a massive discontinuity and that causes the energy to spread over all bands

      6. In order to minimize this spreading effect, one can apply a window, that tapers down the edges of the time domain frame and reduces the discontinuity. On the other hand, the window also smears out the energy in the frequency domain, so you can't get any sharp lines any more.

      7. Many people think that the FFT will give you an "exact" representation of the signal's frequency content. That's not the case unless the time domain signal is either periodic with the FFT length or if it's finite in time. For all other signals the results will depend heavily on the exact process and parameters chosen.

      EDIT: reworded item 7 per the comment






      share|improve this answer











      $endgroup$












      • $begingroup$
        Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
        $endgroup$
        – QuantumPenguin
        Jul 15 at 12:55











      • $begingroup$
        Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:13







      • 1




        $begingroup$
        @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
        $endgroup$
        – Hilmar
        Jul 15 at 15:50










      • $begingroup$
        @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
        $endgroup$
        – Hilmar
        Jul 15 at 15:53










      • $begingroup$
        @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:03















      5












      $begingroup$

      Let's assume we have a sample rate of $f_s=10 kHz$ and FFT size of $N=1000$



      1. Your bin spacing is $delta f = 10 Hz$. It's simply the sample rate divided by the FFT size. That's all there is to it.

      2. Keep in mind that the FFT requires both the time domain and the frequency domain signal to be perodic. Most signals are not, so there needs to be some sort "accommodation" that's specific to the needs for your application.

      3. A real-valued sine wave with a frequency that is an integer multiple of the bin spacing will only show up in two bins symmetric around zero. I.e. a 100 Hz sine wave will show up in bins +10 and -10 (assuming we index the bins from $[-N/2,N/2-1]$

      4. A complex exponential with a frequency that is integer multiple of the bin spacing will only show up in one bin. I.e. a +100 Hz complex exponential will show up bin +10.

      5. A cosine wave with a frequency that's NOT an integer multiple of the bin spacing (e.g. 105Hz) will spread out over all bins. The bulk of the energy will be in the neighborhood of 105 Hz but there will be energy in ALL bins. This is a direct consequence of bullet 2): the FFT assumes periodicity with $N/f_s$. In essence the FFT doesn't calculate the spectrum of the sine wave, but the spectrum of a signal that consists of 1000 sample long snippet of a 105Hz cosine that gets repeated infinite times. At the splice point there is a massive discontinuity and that causes the energy to spread over all bands

      6. In order to minimize this spreading effect, one can apply a window, that tapers down the edges of the time domain frame and reduces the discontinuity. On the other hand, the window also smears out the energy in the frequency domain, so you can't get any sharp lines any more.

      7. Many people think that the FFT will give you an "exact" representation of the signal's frequency content. That's not the case unless the time domain signal is either periodic with the FFT length or if it's finite in time. For all other signals the results will depend heavily on the exact process and parameters chosen.

      EDIT: reworded item 7 per the comment






      share|improve this answer











      $endgroup$












      • $begingroup$
        Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
        $endgroup$
        – QuantumPenguin
        Jul 15 at 12:55











      • $begingroup$
        Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:13







      • 1




        $begingroup$
        @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
        $endgroup$
        – Hilmar
        Jul 15 at 15:50










      • $begingroup$
        @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
        $endgroup$
        – Hilmar
        Jul 15 at 15:53










      • $begingroup$
        @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:03













      5












      5








      5





      $begingroup$

      Let's assume we have a sample rate of $f_s=10 kHz$ and FFT size of $N=1000$



      1. Your bin spacing is $delta f = 10 Hz$. It's simply the sample rate divided by the FFT size. That's all there is to it.

      2. Keep in mind that the FFT requires both the time domain and the frequency domain signal to be perodic. Most signals are not, so there needs to be some sort "accommodation" that's specific to the needs for your application.

      3. A real-valued sine wave with a frequency that is an integer multiple of the bin spacing will only show up in two bins symmetric around zero. I.e. a 100 Hz sine wave will show up in bins +10 and -10 (assuming we index the bins from $[-N/2,N/2-1]$

      4. A complex exponential with a frequency that is integer multiple of the bin spacing will only show up in one bin. I.e. a +100 Hz complex exponential will show up bin +10.

      5. A cosine wave with a frequency that's NOT an integer multiple of the bin spacing (e.g. 105Hz) will spread out over all bins. The bulk of the energy will be in the neighborhood of 105 Hz but there will be energy in ALL bins. This is a direct consequence of bullet 2): the FFT assumes periodicity with $N/f_s$. In essence the FFT doesn't calculate the spectrum of the sine wave, but the spectrum of a signal that consists of 1000 sample long snippet of a 105Hz cosine that gets repeated infinite times. At the splice point there is a massive discontinuity and that causes the energy to spread over all bands

      6. In order to minimize this spreading effect, one can apply a window, that tapers down the edges of the time domain frame and reduces the discontinuity. On the other hand, the window also smears out the energy in the frequency domain, so you can't get any sharp lines any more.

      7. Many people think that the FFT will give you an "exact" representation of the signal's frequency content. That's not the case unless the time domain signal is either periodic with the FFT length or if it's finite in time. For all other signals the results will depend heavily on the exact process and parameters chosen.

      EDIT: reworded item 7 per the comment






      share|improve this answer











      $endgroup$



      Let's assume we have a sample rate of $f_s=10 kHz$ and FFT size of $N=1000$



      1. Your bin spacing is $delta f = 10 Hz$. It's simply the sample rate divided by the FFT size. That's all there is to it.

      2. Keep in mind that the FFT requires both the time domain and the frequency domain signal to be perodic. Most signals are not, so there needs to be some sort "accommodation" that's specific to the needs for your application.

      3. A real-valued sine wave with a frequency that is an integer multiple of the bin spacing will only show up in two bins symmetric around zero. I.e. a 100 Hz sine wave will show up in bins +10 and -10 (assuming we index the bins from $[-N/2,N/2-1]$

      4. A complex exponential with a frequency that is integer multiple of the bin spacing will only show up in one bin. I.e. a +100 Hz complex exponential will show up bin +10.

      5. A cosine wave with a frequency that's NOT an integer multiple of the bin spacing (e.g. 105Hz) will spread out over all bins. The bulk of the energy will be in the neighborhood of 105 Hz but there will be energy in ALL bins. This is a direct consequence of bullet 2): the FFT assumes periodicity with $N/f_s$. In essence the FFT doesn't calculate the spectrum of the sine wave, but the spectrum of a signal that consists of 1000 sample long snippet of a 105Hz cosine that gets repeated infinite times. At the splice point there is a massive discontinuity and that causes the energy to spread over all bands

      6. In order to minimize this spreading effect, one can apply a window, that tapers down the edges of the time domain frame and reduces the discontinuity. On the other hand, the window also smears out the energy in the frequency domain, so you can't get any sharp lines any more.

      7. Many people think that the FFT will give you an "exact" representation of the signal's frequency content. That's not the case unless the time domain signal is either periodic with the FFT length or if it's finite in time. For all other signals the results will depend heavily on the exact process and parameters chosen.

      EDIT: reworded item 7 per the comment







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 15 at 15:56

























      answered Jul 15 at 12:38









      HilmarHilmar

      11.4k12 silver badges18 bronze badges




      11.4k12 silver badges18 bronze badges











      • $begingroup$
        Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
        $endgroup$
        – QuantumPenguin
        Jul 15 at 12:55











      • $begingroup$
        Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:13







      • 1




        $begingroup$
        @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
        $endgroup$
        – Hilmar
        Jul 15 at 15:50










      • $begingroup$
        @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
        $endgroup$
        – Hilmar
        Jul 15 at 15:53










      • $begingroup$
        @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:03
















      • $begingroup$
        Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
        $endgroup$
        – QuantumPenguin
        Jul 15 at 12:55











      • $begingroup$
        Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 13:13







      • 1




        $begingroup$
        @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
        $endgroup$
        – Hilmar
        Jul 15 at 15:50










      • $begingroup$
        @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
        $endgroup$
        – Hilmar
        Jul 15 at 15:53










      • $begingroup$
        @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:03















      $begingroup$
      Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
      $endgroup$
      – QuantumPenguin
      Jul 15 at 12:55





      $begingroup$
      Thanks for the answer. While a very nice anser and a good overview of an FFT in general. I am not convinced by point 1. For example. If I have make an FFT with a $50 rmHz$ span, and that finall FFT will have 1000 points or FFT lines then $delta f = 0.05 rmHz$. This implies that the span of your FFT window and sample rate are some how the same -- I struggle with this!
      $endgroup$
      – QuantumPenguin
      Jul 15 at 12:55













      $begingroup$
      Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 13:13





      $begingroup$
      Hilmar, I suggest you check out my latest blog article: dsprelated.com/showarticle/1284.php Your #7 is completely false.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 13:13





      1




      1




      $begingroup$
      @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
      $endgroup$
      – Hilmar
      Jul 15 at 15:50




      $begingroup$
      @QuantumPenguin: your span is ALWAYS determined by the sample rate. You can't choose it independently.
      $endgroup$
      – Hilmar
      Jul 15 at 15:50












      $begingroup$
      @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
      $endgroup$
      – Hilmar
      Jul 15 at 15:53




      $begingroup$
      @CedronDawg: I agree it's poorly worded. The FFT gives you always an exact result as per it's definition. It's just not the result that most inexperienced people want or expect
      $endgroup$
      – Hilmar
      Jul 15 at 15:53












      $begingroup$
      @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:03




      $begingroup$
      @Hilmar That's exactly what I wanted to check that the sampling rate and the span are somehow coupled/the same. Are you able to provide a reference?
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:03











      2












      $begingroup$

      FFT result bin spacing is proportional to sample rate and inversely proportional to the length of the FFT. Any two of the three (deltaF, SRate, N) can be independant parameters (within the range your equipment allows). That will determine the third. e.g. the maximum range of the two free variables in your spectrum analyzer settings will determine the maximum range of the third dependent variable.



      You have to sample longer (or use samples from a longer window) to tell closer spaced frequency spectra apart. You can't tell a 440 Hz note "A" from a 441 Hz note in fast music. But with a constant concert-A tone for a minute, you can just count the zero crossings in a waveform plot, and see a clear difference of over 100 more zero crossings. Either a longer FFT, or wider bin spacing due to less samples used. And you have to sample faster if you want to see faster changing input (higher maximum frequencies). A higher sample rate.






      share|improve this answer











      $endgroup$












      • $begingroup$
        You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 21:19











      • $begingroup$
        The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
        $endgroup$
        – hotpaw2
        Jul 15 at 22:18











      • $begingroup$
        @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 22:43















      2












      $begingroup$

      FFT result bin spacing is proportional to sample rate and inversely proportional to the length of the FFT. Any two of the three (deltaF, SRate, N) can be independant parameters (within the range your equipment allows). That will determine the third. e.g. the maximum range of the two free variables in your spectrum analyzer settings will determine the maximum range of the third dependent variable.



      You have to sample longer (or use samples from a longer window) to tell closer spaced frequency spectra apart. You can't tell a 440 Hz note "A" from a 441 Hz note in fast music. But with a constant concert-A tone for a minute, you can just count the zero crossings in a waveform plot, and see a clear difference of over 100 more zero crossings. Either a longer FFT, or wider bin spacing due to less samples used. And you have to sample faster if you want to see faster changing input (higher maximum frequencies). A higher sample rate.






      share|improve this answer











      $endgroup$












      • $begingroup$
        You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 21:19











      • $begingroup$
        The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
        $endgroup$
        – hotpaw2
        Jul 15 at 22:18











      • $begingroup$
        @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 22:43













      2












      2








      2





      $begingroup$

      FFT result bin spacing is proportional to sample rate and inversely proportional to the length of the FFT. Any two of the three (deltaF, SRate, N) can be independant parameters (within the range your equipment allows). That will determine the third. e.g. the maximum range of the two free variables in your spectrum analyzer settings will determine the maximum range of the third dependent variable.



      You have to sample longer (or use samples from a longer window) to tell closer spaced frequency spectra apart. You can't tell a 440 Hz note "A" from a 441 Hz note in fast music. But with a constant concert-A tone for a minute, you can just count the zero crossings in a waveform plot, and see a clear difference of over 100 more zero crossings. Either a longer FFT, or wider bin spacing due to less samples used. And you have to sample faster if you want to see faster changing input (higher maximum frequencies). A higher sample rate.






      share|improve this answer











      $endgroup$



      FFT result bin spacing is proportional to sample rate and inversely proportional to the length of the FFT. Any two of the three (deltaF, SRate, N) can be independant parameters (within the range your equipment allows). That will determine the third. e.g. the maximum range of the two free variables in your spectrum analyzer settings will determine the maximum range of the third dependent variable.



      You have to sample longer (or use samples from a longer window) to tell closer spaced frequency spectra apart. You can't tell a 440 Hz note "A" from a 441 Hz note in fast music. But with a constant concert-A tone for a minute, you can just count the zero crossings in a waveform plot, and see a clear difference of over 100 more zero crossings. Either a longer FFT, or wider bin spacing due to less samples used. And you have to sample faster if you want to see faster changing input (higher maximum frequencies). A higher sample rate.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 15 at 22:44

























      answered Jul 15 at 17:45









      hotpaw2hotpaw2

      26.5k5 gold badges34 silver badges74 bronze badges




      26.5k5 gold badges34 silver badges74 bronze badges











      • $begingroup$
        You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 21:19











      • $begingroup$
        The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
        $endgroup$
        – hotpaw2
        Jul 15 at 22:18











      • $begingroup$
        @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 22:43
















      • $begingroup$
        You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 21:19











      • $begingroup$
        The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
        $endgroup$
        – hotpaw2
        Jul 15 at 22:18











      • $begingroup$
        @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
        $endgroup$
        – Cedron Dawg
        Jul 15 at 22:43















      $begingroup$
      You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 21:19





      $begingroup$
      You're kind of conflating resolution (telling two tones apart) with precision (variance of your measurement) there in your second paragraph. You don't need longer intervals for higher precision, but it sure helps with resolution.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 21:19













      $begingroup$
      The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
      $endgroup$
      – hotpaw2
      Jul 15 at 22:18





      $begingroup$
      The extra (left out above) parameter is length vs. S/N. With zero noise and/or interference, specifying a sinewave requires only 3 (or 4?) non-aliased samples. Approaching zero S/N, length for statistical significance goes to infinity. In actual use, the term "resolution" has multiple meanings.
      $endgroup$
      – hotpaw2
      Jul 15 at 22:18













      $begingroup$
      @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 22:43




      $begingroup$
      @QuantumPenguin, Clarifying, common usage and technical word usage issues aside, increasing the interval moves tones up the DFT scale and thus they separate more and are easier to tell apart, independent of N. Keeping the interval the same and changing N, leaves the tones in the same spot on the DFT scale, but shifts where the wraparound point (Nyquist) is. Noise is a side issue, and of course more samples at the same noise level will yield better results. Another side issue, the interval choice for real world applications is also heavily dependent on the expected duration of the sounds.
      $endgroup$
      – Cedron Dawg
      Jul 15 at 22:43











      2












      $begingroup$

      Your confusion is very much understandable because it took me a while to understand the frequency axis spacing issue. Finally after digging for years, I found that your question is answered by the theorem of Cooley (the man who made FT possible on computers) in 1967. It is sad that no textbook addresses this as a theorem but casually mentions in passing.



      More details here: https://chemistry.stackexchange.com/questions/117901/zero-filling-fourier-transform-in-nmr/117919#117919



      The frequency axis spacing issue is a result of a beautiful theorem. I found in Cooley's original paper from 1967 [1, p. 80].




      Theorem 1



      If $x(t), -∞ < t < ∞,$ and $a(f), -∞ < f < ∞,$ are a Fourier integral transform pair,



      $$x(t) ↔ a(f),$$



      then $Tx_p(jΔt), j = 0, 1, cdots, N - 1,$ and $a_p(nΔf), n = 0, 1, 2, cdots, N - 1,$ are a finite Fourier transform pair,



      $$
      beginalign
      Tx_p(jΔt) &= Tsum_l = -∞^∞x(jΔt + lT) ↔ sum_k = -∞^∞a(nΔf + kF) \
      &= a_p(nΔf)
      endalign
      $$



      where $Δf = 1/(NΔt) = 1/T.$



      It is to be remembered that the finite Fourier transform pair



      $$X(j) ↔ A(n)$$



      is defined by



      $$X(j) = sum_n = 0^N - 1A(n)W_N^jn, quad W_N = e^2πi/N$$



      Thus, if two functions are Fourier transforms of one another, then the sequences obtained from them by aliasing and sampling in this fashion are finite Fourier transforms of one another.




      Cooley & Tukey are the key persons who made Discrete Fourier Transform (DFT) possible by computers for lowly mortals like us, otherwise it was an elitist subject among the mathematicians. However, math researchers told me this was known in 1754. Full discussion here: History of Integral Transform Theorem



      References



      1. Cooley, J.; Lewis, P.; Welch, P. Application of the Fast Fourier Transform to Computation of Fourier Integrals, Fourier Series, and Convolution Integrals. IEEE Transactions on Audio and Electroacoustics 1967, 15 (2), 79–84. https://doi.org/10/bmw8z8.





      share|improve this answer











      $endgroup$












      • $begingroup$
        Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:04










      • $begingroup$
        The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
        $endgroup$
        – M. Farooq
        Jul 15 at 16:55
















      2












      $begingroup$

      Your confusion is very much understandable because it took me a while to understand the frequency axis spacing issue. Finally after digging for years, I found that your question is answered by the theorem of Cooley (the man who made FT possible on computers) in 1967. It is sad that no textbook addresses this as a theorem but casually mentions in passing.



      More details here: https://chemistry.stackexchange.com/questions/117901/zero-filling-fourier-transform-in-nmr/117919#117919



      The frequency axis spacing issue is a result of a beautiful theorem. I found in Cooley's original paper from 1967 [1, p. 80].




      Theorem 1



      If $x(t), -∞ < t < ∞,$ and $a(f), -∞ < f < ∞,$ are a Fourier integral transform pair,



      $$x(t) ↔ a(f),$$



      then $Tx_p(jΔt), j = 0, 1, cdots, N - 1,$ and $a_p(nΔf), n = 0, 1, 2, cdots, N - 1,$ are a finite Fourier transform pair,



      $$
      beginalign
      Tx_p(jΔt) &= Tsum_l = -∞^∞x(jΔt + lT) ↔ sum_k = -∞^∞a(nΔf + kF) \
      &= a_p(nΔf)
      endalign
      $$



      where $Δf = 1/(NΔt) = 1/T.$



      It is to be remembered that the finite Fourier transform pair



      $$X(j) ↔ A(n)$$



      is defined by



      $$X(j) = sum_n = 0^N - 1A(n)W_N^jn, quad W_N = e^2πi/N$$



      Thus, if two functions are Fourier transforms of one another, then the sequences obtained from them by aliasing and sampling in this fashion are finite Fourier transforms of one another.




      Cooley & Tukey are the key persons who made Discrete Fourier Transform (DFT) possible by computers for lowly mortals like us, otherwise it was an elitist subject among the mathematicians. However, math researchers told me this was known in 1754. Full discussion here: History of Integral Transform Theorem



      References



      1. Cooley, J.; Lewis, P.; Welch, P. Application of the Fast Fourier Transform to Computation of Fourier Integrals, Fourier Series, and Convolution Integrals. IEEE Transactions on Audio and Electroacoustics 1967, 15 (2), 79–84. https://doi.org/10/bmw8z8.





      share|improve this answer











      $endgroup$












      • $begingroup$
        Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:04










      • $begingroup$
        The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
        $endgroup$
        – M. Farooq
        Jul 15 at 16:55














      2












      2








      2





      $begingroup$

      Your confusion is very much understandable because it took me a while to understand the frequency axis spacing issue. Finally after digging for years, I found that your question is answered by the theorem of Cooley (the man who made FT possible on computers) in 1967. It is sad that no textbook addresses this as a theorem but casually mentions in passing.



      More details here: https://chemistry.stackexchange.com/questions/117901/zero-filling-fourier-transform-in-nmr/117919#117919



      The frequency axis spacing issue is a result of a beautiful theorem. I found in Cooley's original paper from 1967 [1, p. 80].




      Theorem 1



      If $x(t), -∞ < t < ∞,$ and $a(f), -∞ < f < ∞,$ are a Fourier integral transform pair,



      $$x(t) ↔ a(f),$$



      then $Tx_p(jΔt), j = 0, 1, cdots, N - 1,$ and $a_p(nΔf), n = 0, 1, 2, cdots, N - 1,$ are a finite Fourier transform pair,



      $$
      beginalign
      Tx_p(jΔt) &= Tsum_l = -∞^∞x(jΔt + lT) ↔ sum_k = -∞^∞a(nΔf + kF) \
      &= a_p(nΔf)
      endalign
      $$



      where $Δf = 1/(NΔt) = 1/T.$



      It is to be remembered that the finite Fourier transform pair



      $$X(j) ↔ A(n)$$



      is defined by



      $$X(j) = sum_n = 0^N - 1A(n)W_N^jn, quad W_N = e^2πi/N$$



      Thus, if two functions are Fourier transforms of one another, then the sequences obtained from them by aliasing and sampling in this fashion are finite Fourier transforms of one another.




      Cooley & Tukey are the key persons who made Discrete Fourier Transform (DFT) possible by computers for lowly mortals like us, otherwise it was an elitist subject among the mathematicians. However, math researchers told me this was known in 1754. Full discussion here: History of Integral Transform Theorem



      References



      1. Cooley, J.; Lewis, P.; Welch, P. Application of the Fast Fourier Transform to Computation of Fourier Integrals, Fourier Series, and Convolution Integrals. IEEE Transactions on Audio and Electroacoustics 1967, 15 (2), 79–84. https://doi.org/10/bmw8z8.





      share|improve this answer











      $endgroup$



      Your confusion is very much understandable because it took me a while to understand the frequency axis spacing issue. Finally after digging for years, I found that your question is answered by the theorem of Cooley (the man who made FT possible on computers) in 1967. It is sad that no textbook addresses this as a theorem but casually mentions in passing.



      More details here: https://chemistry.stackexchange.com/questions/117901/zero-filling-fourier-transform-in-nmr/117919#117919



      The frequency axis spacing issue is a result of a beautiful theorem. I found in Cooley's original paper from 1967 [1, p. 80].




      Theorem 1



      If $x(t), -∞ < t < ∞,$ and $a(f), -∞ < f < ∞,$ are a Fourier integral transform pair,



      $$x(t) ↔ a(f),$$



      then $Tx_p(jΔt), j = 0, 1, cdots, N - 1,$ and $a_p(nΔf), n = 0, 1, 2, cdots, N - 1,$ are a finite Fourier transform pair,



      $$
      beginalign
      Tx_p(jΔt) &= Tsum_l = -∞^∞x(jΔt + lT) ↔ sum_k = -∞^∞a(nΔf + kF) \
      &= a_p(nΔf)
      endalign
      $$



      where $Δf = 1/(NΔt) = 1/T.$



      It is to be remembered that the finite Fourier transform pair



      $$X(j) ↔ A(n)$$



      is defined by



      $$X(j) = sum_n = 0^N - 1A(n)W_N^jn, quad W_N = e^2πi/N$$



      Thus, if two functions are Fourier transforms of one another, then the sequences obtained from them by aliasing and sampling in this fashion are finite Fourier transforms of one another.




      Cooley & Tukey are the key persons who made Discrete Fourier Transform (DFT) possible by computers for lowly mortals like us, otherwise it was an elitist subject among the mathematicians. However, math researchers told me this was known in 1754. Full discussion here: History of Integral Transform Theorem



      References



      1. Cooley, J.; Lewis, P.; Welch, P. Application of the Fast Fourier Transform to Computation of Fourier Integrals, Fourier Series, and Convolution Integrals. IEEE Transactions on Audio and Electroacoustics 1967, 15 (2), 79–84. https://doi.org/10/bmw8z8.






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jul 17 at 23:20

























      answered Jul 15 at 15:23









      M. FarooqM. Farooq

      1507 bronze badges




      1507 bronze badges











      • $begingroup$
        Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:04










      • $begingroup$
        The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
        $endgroup$
        – M. Farooq
        Jul 15 at 16:55

















      • $begingroup$
        Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
        $endgroup$
        – QuantumPenguin
        Jul 15 at 16:04










      • $begingroup$
        The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
        $endgroup$
        – M. Farooq
        Jul 15 at 16:55
















      $begingroup$
      Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:04




      $begingroup$
      Nice answer! The one thing I would really like to see is a relation between the sampling rate and the span.
      $endgroup$
      – QuantumPenguin
      Jul 15 at 16:04












      $begingroup$
      The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
      $endgroup$
      – M. Farooq
      Jul 15 at 16:55





      $begingroup$
      The sampling frequency of the experimental data determines the maximum value of the frequency axis in the Fourier domain. For example, if my sampling frequency was 250 Hz, after fft the frequency axis will end at 125 Hz. This is another theorem or criteria attributed to Nyquist. Although you will find ten other names associated with the same concept. This assumes the number of data point are even. I have asked similar questions like these at length in this forum and MATLAB forums. Search FFT and DFT even and odd. It was a good discussion.
      $endgroup$
      – M. Farooq
      Jul 15 at 16:55












      0












      $begingroup$

      In a real spectrum analyzer the input sample rate may be wider than the pass band of the upstream filters. After the FFT, only the frequencies in the passband of the filter are shown in the span. So the first equation you showed is for you don't crop anything in the frequency domain, the other equations are more general.



      Also real spectrum analyzers will apply a window function to the time domain to give the frequency domain a nice shape this typically makes the actual resolution bandwidth several bins wide, so the FFT bin spacing is not as relevant.






      share|improve this answer









      $endgroup$

















        0












        $begingroup$

        In a real spectrum analyzer the input sample rate may be wider than the pass band of the upstream filters. After the FFT, only the frequencies in the passband of the filter are shown in the span. So the first equation you showed is for you don't crop anything in the frequency domain, the other equations are more general.



        Also real spectrum analyzers will apply a window function to the time domain to give the frequency domain a nice shape this typically makes the actual resolution bandwidth several bins wide, so the FFT bin spacing is not as relevant.






        share|improve this answer









        $endgroup$















          0












          0








          0





          $begingroup$

          In a real spectrum analyzer the input sample rate may be wider than the pass band of the upstream filters. After the FFT, only the frequencies in the passband of the filter are shown in the span. So the first equation you showed is for you don't crop anything in the frequency domain, the other equations are more general.



          Also real spectrum analyzers will apply a window function to the time domain to give the frequency domain a nice shape this typically makes the actual resolution bandwidth several bins wide, so the FFT bin spacing is not as relevant.






          share|improve this answer









          $endgroup$



          In a real spectrum analyzer the input sample rate may be wider than the pass band of the upstream filters. After the FFT, only the frequencies in the passband of the filter are shown in the span. So the first equation you showed is for you don't crop anything in the frequency domain, the other equations are more general.



          Also real spectrum analyzers will apply a window function to the time domain to give the frequency domain a nice shape this typically makes the actual resolution bandwidth several bins wide, so the FFT bin spacing is not as relevant.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 16 at 17:42









          ahavensahavens

          11 bronze badge




          11 bronze badge





















              0












              $begingroup$

              Just a quick note, thanks to all for the contributions. Together you helped me understand my problem. Essentially what we can say is that the size of the final FFT window or the span, is simply $$span = Delta f left( fracN_s2 - 1 right)$$ or in context of the sample frequency, $f_s$, $$ span = f_s left( frac12 - frac1N_s right)$$. Where $N_s$ is the number of samples to be FFT's ($N_s / 2$ is the number of points left in the final FFT result as we throw half away because of mirroring), and $Delta f = f_s / N_s$ is the line width resolution.



              $1/Delta_f$ is the amount of time required to take a transient signal due to the Fourier limit.






              share|improve this answer









              $endgroup$

















                0












                $begingroup$

                Just a quick note, thanks to all for the contributions. Together you helped me understand my problem. Essentially what we can say is that the size of the final FFT window or the span, is simply $$span = Delta f left( fracN_s2 - 1 right)$$ or in context of the sample frequency, $f_s$, $$ span = f_s left( frac12 - frac1N_s right)$$. Where $N_s$ is the number of samples to be FFT's ($N_s / 2$ is the number of points left in the final FFT result as we throw half away because of mirroring), and $Delta f = f_s / N_s$ is the line width resolution.



                $1/Delta_f$ is the amount of time required to take a transient signal due to the Fourier limit.






                share|improve this answer









                $endgroup$















                  0












                  0








                  0





                  $begingroup$

                  Just a quick note, thanks to all for the contributions. Together you helped me understand my problem. Essentially what we can say is that the size of the final FFT window or the span, is simply $$span = Delta f left( fracN_s2 - 1 right)$$ or in context of the sample frequency, $f_s$, $$ span = f_s left( frac12 - frac1N_s right)$$. Where $N_s$ is the number of samples to be FFT's ($N_s / 2$ is the number of points left in the final FFT result as we throw half away because of mirroring), and $Delta f = f_s / N_s$ is the line width resolution.



                  $1/Delta_f$ is the amount of time required to take a transient signal due to the Fourier limit.






                  share|improve this answer









                  $endgroup$



                  Just a quick note, thanks to all for the contributions. Together you helped me understand my problem. Essentially what we can say is that the size of the final FFT window or the span, is simply $$span = Delta f left( fracN_s2 - 1 right)$$ or in context of the sample frequency, $f_s$, $$ span = f_s left( frac12 - frac1N_s right)$$. Where $N_s$ is the number of samples to be FFT's ($N_s / 2$ is the number of points left in the final FFT result as we throw half away because of mirroring), and $Delta f = f_s / N_s$ is the line width resolution.



                  $1/Delta_f$ is the amount of time required to take a transient signal due to the Fourier limit.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 18 at 16:43









                  QuantumPenguinQuantumPenguin

                  1396 bronze badges




                  1396 bronze badges



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Signal Processing Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdsp.stackexchange.com%2fquestions%2f59519%2fclarification-on-defining-fft-bin-sizes%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                      Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                      Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림