DSPRelated.com
Forums

proper terminology for one bin of an fft/dft?

Started by Ron N. March 13, 2006
On Tue, 21 Mar 2006 11:23:02 +1100, John Monro
<johnmonro@optusnet.com.au> wrote:

>Rick Lyons wrote: >(snip) >> >> "The DFT's second and third bins centers >> (2*Fs/N and 3*Fs/N respectively) are separated >> by 100 Hz." >> > > >Rick, > >Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? > >Regards, >John
Hi John, Yep. I should have written "(Fs/N and 2*Fs/N respectively)". Darn, sorry for the confusion. I usually refer to the 0-Hz bin (DC) as the "first bin". Thanks for catchin' my mistake John. [-Rick-]
On 21 Mar 2006 11:19:57 -0800, "Andor" <andor.bariska@gmail.com>
wrote:

>uh oh
LOL! That was more or less my thought as well. ;) Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
On Mon, 20 Mar 2006 22:58:58 -0500, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>in article 1142906425.123342.171790@u72g2000cwu.googlegroups.com, Ron N. at >rhnlogic@yahoo.com wrote on 03/20/2006 21:00: > >> John Monro wrote: >>> Rick Lyons wrote: >>> (snip) >>>> >>>> "The DFT's second and third bins centers >>>> (2*Fs/N and 3*Fs/N respectively) are separated >>>> by 100 Hz." >>>> >>> >>> >>> Rick, >>> >>> Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >> >> More nomeclature ambiguity. Is the DC term of a DFT/FFT more >> commonly refered to as the first bin or the zero-th bin? > >it depends on if you're a MATLAB or Fortran user (and happy with it) or not. > >i heartily disagree with John Monro on this, but we are all free to believe >what we will about the same. it is not the time of Galileo.
Not surprisingly, I'm with you here. To call bin one, which has exactly one sinusoidal cycle per bin, the second bin just adds confusion. The zeroth bin is DC, or zero Hz, or zero cycles per aperture. In this case the nomenclature is consistent with the meaning of the indices. Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
On Tue, 21 Mar 2006 19:02:50 GMT, Mark Borgerding
<mark@borgerding.net> wrote:

>The DFT does not "sample" a continuous spectrum. > >Not unless you extend your analogy to include a sin(x)/x filter that is >applied to the frequency domain before sampling. This would duplicate >the effects of the time-windowing inherent in any DFT. too much > >If the DFT *did* sample the continuous spectrum, then the DFT of a time >sequence with a single sinusoid would be all zeros except in the lucky >case where the time window happened to concide exactly with a integer >number of the sinusoidal periods. > > >Consider this from another perspective: >If a time domain sequence with a single pulse is sampled, such that > pulse duration << sampling period >(In other words, not band-limited) >There are two possibilities for how the sampling will turn out, >depending on phase: > 1) There is one non-zero sample. > 2) All samples are zero >Energy is aliased in both case. In the first case, the aliasing is >constructive, in the second case, the aliased spectra destroy each other. > >If time-domain sampling acted as you suggest (i.e. convolved with a >sinc) then the pulse would be sampled as a sinc wave, implying that the >anti-aliasing were somehow implicit in the sampling process.
Just to catch up a little: Mark, I did like your water baloon analogy to a point. Like most analogies it has it's limitations but the idea of not having splatter when you hit the bin exactly was pretty cool. I think, however, that the current arguments are somewhat semantic, as I think many of these sorts of arguments ultimately turn out to be. The fact that the DFT/FFT has an inverse suggests that it does essentially mean that it can easily be interpreted as a sampling of the frequency domain. The nuances of what happens between the samples can be argued in both the time and frequency domains. The nuances of the details between bins is, IMHO, more a function of having a finite analysis window than anything. Consider that as the length of the window grows to infinity, the sinx/x issues become smaller and smaller and ultimately vanish with the window. There are some additional concerns as we all know (well, as many of us know), but I wouldn't argue that the frequency domain coefficients of an FFT _aren't_ just frequency-domain samples. From certain perspectives that's actually a quite good description of their nature. Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
Rick Lyons wrote:
> On Tue, 21 Mar 2006 11:23:02 +1100, John Monro > <johnmonro@optusnet.com.au> wrote: > > >>Rick Lyons wrote: >>(snip) >> >>> "The DFT's second and third bins centers >>> (2*Fs/N and 3*Fs/N respectively) are separated >>> by 100 Hz." >>> >> >> >>Rick, >> >>Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >> >>Regards, >>John > > > Hi John, > > Yep. I should have written "(Fs/N and 2*Fs/N respectively)". > Darn, sorry for the confusion. I usually refer to the > 0-Hz bin (DC) as the "first bin". > > Thanks for catchin' my mistake John. > [-Rick-] > >
Rick, It's not often I get the chance! I didn't think you had gone over to the Dark Side, so thought I would point out the momentary lapse :-). Regards, John
Bob Cain wrote:
> Mark Borgerding wrote: > > Bob Cain wrote: > >> Ron N. wrote: > >> > >>> What is the proper or most common term for computing or > >>> describing only one bin of an fft or dft? > >> > >> I wish there were. Bin intimates that some kind of collection is > >> occurring there when it is really a sample of the underlying continuous > >> frequency domain function evaluated at one specific frequency. > > > > Consider a set of bins lined up as water balloon targets at a carnival. > > Each bin is just barely wide enough to accept a balloon. So if you > > throw the balloon absolutely perfectly into one of the bins, all the > > water goes into that bin (you win a prize). If you don't throw > > perfectly; the balloon explodes and splashes water everywhere. > > Naturally, most of the water will end up in the bins adjoining the wall > > that was hit. > > > > > > What do you think? Does this analogy hold water? > > > > > > > > The underlying assumption of the DFT rarely (never) matches reality. The > > signal is assumed to be periodic at the DFT length. i.e. there are no > > frequencies other than those at multiples of fs/N (the "bins"). In the > > real world, the DFT is used to detect the frequencies of a signal that > > is not periodic. > > > > This mismatch causes a convolution in the frequency domain: the > > convolution of sin(x)/x and the "actual" frequency spectrum. > > > > A sinusoid with a frequency that is a multiple of fs/N will have all of > > its energy placed into one bin. > > > > Any other sinusoid will spread its energy across all the bins. > > > > -- Mark Borgerding > > Consider the transform of an FIR. There is a smooth frequency domain > function describing it. If you process a sweep with it, the continuous > nature becomes clear. It obviously has values at places other than at > the "bins" of any FFT long enough to encompass it and if you look at the > continuous function, which the sweep discloses, at the "bin" frequencies > of the transform it will equal what the transform says it is at those > frequencies. > > The DFT samples the continuous frequency domain function that actually > describes what the FIR will do. No water splashed anywhere that I can > see. :-)
There is a *lot* of splashing. A DFT implies a finite length vector. But any window on the real world to create a finite vector will cause aliasing. Any frequency content in the signal that is not an *exact* multiple of fs/n will, after the windowing and fft, look like a sinc pulse splashing amplitude all over every bin to the limits of the arithmetic precision. Since a continuous signal can only be reconstructed from the samples only if a signal is perfectly bandlimited and infinite in extent, the continuous function and the continuous spectrum of any signal from the real world can only be approximated by the samples. So I think it is reasonable to talk about them separately, unless you are talking only about artificial or theoretical signals. Your assumption of an infinitely repeating signal is only an artifact of the finite length window, and rarely ever applies to any actual signal or set of samples. If is very tempting to make assumptions which help make a mathematical analysis become more tractable. But with the help of computers these days we can sometimes calculate estimates of results without making as many false assumptions about the actual underlying signal. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Eric Jacobsen wrote:
> On Mon, 20 Mar 2006 22:58:58 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > > >>in article 1142906425.123342.171790@u72g2000cwu.googlegroups.com, Ron N. at >>rhnlogic@yahoo.com wrote on 03/20/2006 21:00: >> >> >>>John Monro wrote: >>> >>>>Rick Lyons wrote: >>>>(snip) >>>> >>>>>"The DFT's second and third bins centers >>>>>(2*Fs/N and 3*Fs/N respectively) are separated >>>>>by 100 Hz." >>>>> >>>> >>>> >>>>Rick, >>>> >>>>Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >>> >>>More nomeclature ambiguity. Is the DC term of a DFT/FFT more >>>commonly refered to as the first bin or the zero-th bin? >> >>it depends on if you're a MATLAB or Fortran user (and happy with it) or not. >> >>i heartily disagree with John Monro on this, but we are all free to believe >>what we will about the same. it is not the time of Galileo. > > > Not surprisingly, I'm with you here. To call bin one, which has > exactly one sinusoidal cycle per bin, the second bin just adds > confusion. > > The zeroth bin is DC, or zero Hz, or zero cycles per aperture. In > this case the nomenclature is consistent with the meaning of the > indices. > Eric Jacobsen
Eric and Robert, I have NEVER found anyone to be confused at the concept that the second bin contains the amplitude of F1 and that the first bin contains the amplitude of F0. If there is anyone who is confused by this then I don't think DSP would be a very wise career choice for them. :=) In computing generally, when we process arrays of numbers the 'natural' numbering of the elements does NOT correspond to the index numbers we choose to use for their storage. I think that in general it is a bad principle to change conventions to suit the problem. In the case of the FFT you see some advantage in nominating the initial element as the 'zero-th' but what great advantage does this give? Compare any advantage gained here with the incredible confusion that would result if the concept of 'first' became relative, and was Dependant on the problem at hand. Regards, John
Eric Jacobsen wrote:
> On Mon, 20 Mar 2006 22:58:58 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > > >>in article 1142906425.123342.171790@u72g2000cwu.googlegroups.com, Ron N. at >>rhnlogic@yahoo.com wrote on 03/20/2006 21:00: >> >> >>>John Monro wrote: >>> >>>>Rick Lyons wrote: >>>>(snip) >>>> >>>>>"The DFT's second and third bins centers >>>>>(2*Fs/N and 3*Fs/N respectively) are separated >>>>>by 100 Hz." >>>>> >>>> >>>> >>>>Rick, >>>> >>>>Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >>> >>>More nomeclature ambiguity. Is the DC term of a DFT/FFT more >>>commonly refered to as the first bin or the zero-th bin? >> >>it depends on if you're a MATLAB or Fortran user (and happy with it) or not. >> >>i heartily disagree with John Monro on this, but we are all free to believe >>what we will about the same. it is not the time of Galileo. > > > Not surprisingly, I'm with you here. To call bin one, which has > exactly one sinusoidal cycle per bin, the second bin just adds > confusion. > > The zeroth bin is DC, or zero Hz, or zero cycles per aperture. In > this case the nomenclature is consistent with the meaning of the > indices. > Eric Jacobsen
Eric and Robert, I have NEVER found anyone to be confused at the concept that the second bin contains the amplitude of F1 and that the first bin contains the amplitude of F0. If there is anyone who is confused by this then I don't think DSP would be a very wise career choice for them. :=) In computing generally, when we process arrays of numbers the 'natural' numbering of the elements does NOT correspond to the index numbers we choose to use for their storage. I think that in general it is a bad principle to change conventions to suit the problem. In the case of the FFT you see some advantage in nominating the initial element as the 'zero-th' but what great advantage does this give? Compare any advantage gained here with the incredible confusion that would result if the concept of 'first' became relative, and was Dependant on the problem at hand. Regards, John
Eric Jacobsen wrote:
> On Mon, 20 Mar 2006 22:58:58 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > > >>in article 1142906425.123342.171790@u72g2000cwu.googlegroups.com, Ron N. at >>rhnlogic@yahoo.com wrote on 03/20/2006 21:00: >> >> >>>John Monro wrote: >>> >>>>Rick Lyons wrote: >>>>(snip) >>>> >>>>>"The DFT's second and third bins centers >>>>>(2*Fs/N and 3*Fs/N respectively) are separated >>>>>by 100 Hz." >>>>> >>>> >>>> >>>>Rick, >>>> >>>>Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >>> >>>More nomeclature ambiguity. Is the DC term of a DFT/FFT more >>>commonly refered to as the first bin or the zero-th bin? >> >>it depends on if you're a MATLAB or Fortran user (and happy with it) or not. >> >>i heartily disagree with John Monro on this, but we are all free to believe >>what we will about the same. it is not the time of Galileo. > > > Not surprisingly, I'm with you here. To call bin one, which has > exactly one sinusoidal cycle per bin, the second bin just adds > confusion. > > The zeroth bin is DC, or zero Hz, or zero cycles per aperture. In > this case the nomenclature is consistent with the meaning of the > indices. > Eric Jacobsen
Eric and Robert, I have NEVER found anyone to be confused at the concept that the second bin contains the amplitude of F1 and that the first bin contains the amplitude of F0. If there is anyone who is confused by this then I don't think DSP would be a very wise career choice for them. :=) In computing generally, when we process arrays of numbers the 'natural' numbering of the elements does NOT correspond to the index numbers we choose to use for their storage. I think that in general it is a bad principle to change conventions to suit the problem. In the case of the FFT you see some advantage in nominating the initial element as the 'zero-th' but what great advantage does this give? Compare any advantage gained here with the incredible confusion that would result if the concept of 'first' became relative, and was Dependant on the problem at hand. Regards, John
Eric Jacobsen wrote:
> On Mon, 20 Mar 2006 22:58:58 -0500, robert bristow-johnson > <rbj@audioimagination.com> wrote: > > >>in article 1142906425.123342.171790@u72g2000cwu.googlegroups.com, Ron N. at >>rhnlogic@yahoo.com wrote on 03/20/2006 21:00: >> >> >>>John Monro wrote: >>> >>>>Rick Lyons wrote: >>>>(snip) >>>> >>>>>"The DFT's second and third bins centers >>>>>(2*Fs/N and 3*Fs/N respectively) are separated >>>>>by 100 Hz." >>>>> >>>> >>>> >>>>Rick, >>>> >>>>Shouldn't that be "... (Fs/N and 2*Fs/N respectively)..."? >>> >>>More nomeclature ambiguity. Is the DC term of a DFT/FFT more >>>commonly refered to as the first bin or the zero-th bin? >> >>it depends on if you're a MATLAB or Fortran user (and happy with it) or not. >> >>i heartily disagree with John Monro on this, but we are all free to believe >>what we will about the same. it is not the time of Galileo. > > > Not surprisingly, I'm with you here. To call bin one, which has > exactly one sinusoidal cycle per bin, the second bin just adds > confusion. > > The zeroth bin is DC, or zero Hz, or zero cycles per aperture. In > this case the nomenclature is consistent with the meaning of the > indices. > Eric Jacobsen
Eric and Robert, I have NEVER found anyone to be confused at the concept that the second bin contains the amplitude of F1 and that the first bin contains the amplitude of F0. If there is anyone who is confused by this then I don't think DSP would be a very wise career choice for them. :=) In computing generally, when we process arrays of numbers the 'natural' numbering of the elements does NOT correspond to the index numbers we choose to use for their storage. I think that in general it is a bad principle to change conventions to suit the problem. In the case of the FFT you see some advantage in nominating the initial element as the 'zero-th' but what great advantage does this give? Compare any advantage gained here with the incredible confusion that would result if the concept of 'first' became relative, and was Dependant on the problem at hand. Regards, John