"Jerry Avins" <jya@ieee.org> wrote in message news:962dnRc7VepIBgvYnZ2dnUVZ_vjinZ2d@rcn.net...> John E. Hadstate wrote: >> "Jerry Avins" <jya@ieee.org> wrote in message >> news:jJSdnSH-TLqZCAvYnZ2dnUVZ_q3inZ2d@rcn.net... >>> Isn't "power" magnitude squared? (The presumed digital >>> impedance being 1.) >> >> How about if the thing you are analyzing is measured in >> units of "power" or "energy"? > > I don't think that energy has real and complex parts. As > to power, I have no idea what the square root of (watts^2 > + vars^2) might represent. >Nevertheless, one can measure, sample, and analyze real energy or power and obtain a spectrum having non-zero real and imaginary components. In that case, the square root of the sum of the squared components would be a magnitude in units of energy or power. The wonderful thing about DSP is that you can use it to compute the average age of half-a-cow as long as you're consistent.
Empirically Optimized FFT bin interpolator
Started by ●December 28, 2006
Reply by ●December 30, 20062006-12-30
Reply by ●December 30, 20062006-12-30
John E. Hadstate wrote:> "Jerry Avins" <jya@ieee.org> wrote in message > news:962dnRc7VepIBgvYnZ2dnUVZ_vjinZ2d@rcn.net... >> John E. Hadstate wrote: >>> "Jerry Avins" <jya@ieee.org> wrote in message >>> news:jJSdnSH-TLqZCAvYnZ2dnUVZ_q3inZ2d@rcn.net... >>>> Isn't "power" magnitude squared? (The presumed digital >>>> impedance being 1.) >>> How about if the thing you are analyzing is measured in >>> units of "power" or "energy"? >> I don't think that energy has real and complex parts. As >> to power, I have no idea what the square root of (watts^2 >> + vars^2) might represent. >> > > Nevertheless, one can measure, sample, and analyze real > energy or power and obtain a spectrum having non-zero real > and imaginary components. In that case, the square root of > the sum of the squared components would be a magnitude in > units of energy or power. > > The wonderful thing about DSP is that you can use it to > compute the average age of half-a-cow as long as you're > consistent.I guess you're right in general. getting down to specific instances, I like to know the meanings of the terms so I can be sure I'm being consistent. (The error of equating energy to torque won't be turned up by a dimension check.) Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●December 30, 20062006-12-30
Philip Martel wrote:> "Ron N." <rhnlogic@yahoo.com> wrote in message > news:1167350167.822574.57430@n51g2000cwc.googlegroups.com... > > Philip Martel wrote: > >> "Ron N." <rhnlogic@yahoo.com> wrote in message > >> news:1167342623.830346.125920@a3g2000cwd.googlegroups.com... > >> > > >> > Philip Martel wrote: > >> >> "Ron N." <rhnlogic@yahoo.com> wrote in message > >> >> news:1167337278.960522.51310@73g2000cwn.googlegroups.com... > >> >> > Robert Scott wrote: > >> > A dft does not "act" on its own. It's only a complex vector > >> > transform whose results are up to interpretation. > >> True, but I think almost everyone here understands what I meant. > >> > >> I guess my point was that I have trouble with your equating "no window" > >> with > >> a "rectangular window". > > > > Understand that "no window" on a finite length fft of real > > world data (non-synchronized) is the same as a rectangular > > window whose length is the same as that of the fft aperture. > > Knowing this is a key to understanding some of what an fft > > will do to an arbitrary frequency periodic waveform. > > > > This window will transform any non-bin frequency sinusoid > > into a sampled sinc. (Actually it will do the same to a bin > > frequency sinusoid. But that sinc will be positioned so as > > to have zeros at every bin location except one. So the > > sampling will make that sinc look the same as an impulse.) > > I'm trying to see this. Could you show me an example where the magnitude of > the transform of a non-bin frequency sinusoid decreases and then increases > as the magnitude of a sinc would do? I've used the following code in Octave > T = (0:8191)/8192; > D = sin(2*pi*f*T); > FT = fft(D,8192); > plot(0:8191,abs(FT),'-') > > with f set to numbers like 1000.05, 1000.1, 1000.2. > As far as I can see, the magnitude after the peak is monotonicly decreasing > towards 4096.It only looks this way because you are: 1) taking the abs(), which will produce only positive results 2) plotting the same point on each sinc lobe as the lobes decrease in amplitude away from the center frequency. To see the sinc function, try plotting the Re part of a single dft bin as you gradually vary the frequency from a half dozen bins below to a half dozen bins above the plotted bins frequency. This will slide your graphic sampling point along the sinc.> > IMHO. YMMV. > > -- > > rhn A.T nicholson d.0.t C-o-M > >
Reply by ●December 30, 20062006-12-30
Ron N. wrote:> Philip Martel wrote: > > "Ron N." <rhnlogic@yahoo.com> wrote in message > > news:1167350167.822574.57430@n51g2000cwc.googlegroups.com... > > > Philip Martel wrote: > > >> "Ron N." <rhnlogic@yahoo.com> wrote in message > > >> news:1167342623.830346.125920@a3g2000cwd.googlegroups.com... > > >> > > > >> > Philip Martel wrote: > > >> >> "Ron N." <rhnlogic@yahoo.com> wrote in message > > >> >> news:1167337278.960522.51310@73g2000cwn.googlegroups.com... > > >> >> > Robert Scott wrote: > > >> > A dft does not "act" on its own. It's only a complex vector > > >> > transform whose results are up to interpretation. > > >> True, but I think almost everyone here understands what I meant. > > >> > > >> I guess my point was that I have trouble with your equating "no window" > > >> with > > >> a "rectangular window". > > > > > > Understand that "no window" on a finite length fft of real > > > world data (non-synchronized) is the same as a rectangular > > > window whose length is the same as that of the fft aperture. > > > Knowing this is a key to understanding some of what an fft > > > will do to an arbitrary frequency periodic waveform. > > > > > > This window will transform any non-bin frequency sinusoid > > > into a sampled sinc. (Actually it will do the same to a bin > > > frequency sinusoid. But that sinc will be positioned so as > > > to have zeros at every bin location except one. So the > > > sampling will make that sinc look the same as an impulse.) > > > > I'm trying to see this. Could you show me an example where the magnitude of > > the transform of a non-bin frequency sinusoid decreases and then increases > > as the magnitude of a sinc would do? I've used the following code in Octave > > T = (0:8191)/8192; > > D = sin(2*pi*f*T); > > FT = fft(D,8192); > > plot(0:8191,abs(FT),'-') > > > > with f set to numbers like 1000.05, 1000.1, 1000.2. > > As far as I can see, the magnitude after the peak is monotonicly decreasing > > towards 4096. > > It only looks this way because you are: > 1) taking the abs(), which will produce only positive results > 2) plotting the same point on each sinc lobe as the lobes > decrease in amplitude away from the center frequency. > > To see the sinc function, try plotting the Re part of a single dft bin > as you gradually vary the frequency from a half dozen bins below > to a half dozen bins above the plotted bins frequency. This will > slide your graphic sampling point along the sinc.Almost forgot... To see this using the Re part, make sure your sinusoid stays even (left as an exercise for the student) as you sweep its frequency. IMHO. YMMV. -- Ron N. http://www.nicholson.com/rhn/dsp.html
Reply by ●December 30, 20062006-12-30
Jerry Avins wrote:> (The error of equating energy to torque won't be turned up > by a dimension check.) >Hello Jerry, of course it depends on which dimensions you are talking about. Dimensional analysis by looking at units will fail you here, but torque is a vector and energy is a scalar, so the number of dimensions will be different. Although one may refer to the magnitude of a torque and here one gets into trouble. A standard question I ask my students is why I don't write a torque's magnitude in terms of Joules and instead I always leave it as Newton-meters? Clay
Reply by ●December 30, 20062006-12-30
"Ron N." <rhnlogic@yahoo.com> wrote in message <snip>>> > Understand that "no window" on a finite length fft of real >> > world data (non-synchronized) is the same as a rectangular >> > window whose length is the same as that of the fft aperture. >> > Knowing this is a key to understanding some of what an fft >> > will do to an arbitrary frequency periodic waveform. >> > >> > This window will transform any non-bin frequency sinusoid >> > into a sampled sinc. (Actually it will do the same to a bin >> > frequency sinusoid. But that sinc will be positioned so as >> > to have zeros at every bin location except one. So the >> > sampling will make that sinc look the same as an impulse.) >> >> I'm trying to see this. Could you show me an example where the magnitude >> of >> the transform of a non-bin frequency sinusoid decreases and then >> increases >> as the magnitude of a sinc would do? I've used the following code in >> Octave >> T = (0:8191)/8192; >> D = sin(2*pi*f*T); >> FT = fft(D,8192); >> plot(0:8191,abs(FT),'-') >> >> with f set to numbers like 1000.05, 1000.1, 1000.2. >> As far as I can see, the magnitude after the peak is monotonicly >> decreasing >> towards 4096. > > It only looks this way because you are: > 1) taking the abs(), which will produce only positive results > 2) plotting the same point on each sinc lobe as the lobes > decrease in amplitude away from the center frequency. > > To see the sinc function, try plotting the Re part of a single dft bin > as you gradually vary the frequency from a half dozen bins below > to a half dozen bins above the plotted bins frequency. This will > slide your graphic sampling point along the sinc.Thanks for your patience. I'm getting results as you describe. Best wishes, --Phil Martel> >> > IMHO. YMMV. >> > -- >> > rhn A.T nicholson d.0.t C-o-M >> > >
Reply by ●December 30, 20062006-12-30
Clay wrote:> Jerry Avins wrote: >> (The error of equating energy to torque won't be turned up >> by a dimension check.) >> > > Hello Jerry, of course it depends on which dimensions you are talking > about. Dimensional analysis by looking at units will fail you here, but > torque is a vector and energy is a scalar, so the number of dimensions > will be different. Although one may refer to the magnitude of a torque > and here one gets into trouble. A standard question I ask my students > is why I don't write a torque's magnitude in terms of Joules and > instead I always leave it as Newton-meters?It's not immediately intuitive that the direction of a torque is perpendicular to the plane in which the couple that generates it lies, but of course, there's no other way for it to be. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 1, 20072007-01-01
Philip Martel wrote:> "Ron N." <rhnlogic@yahoo.com> wrote in message > news:1167342623.830346.125920@a3g2000cwd.googlegroups.com... > > > > Philip Martel wrote: > >> "Ron N." <rhnlogic@yahoo.com> wrote in message > >> news:1167337278.960522.51310@73g2000cwn.googlegroups.com... > >> > Robert Scott wrote: > >> >> FYI, the FFTs use in my development were 8192-point and 65536-point. > >> >> No windowing was used. > >> > > >> > By no windowing I assume you mean a rectangular window > >> > (whose transform is a sinc function), since 65536 is a finite > >> > number. > >> As I understand it, FFT( Data, n) acts as if the n Data points are > >> repeated.i would say that this understanding is correct, even though we have periodically gotten into fights about this on comp.dsp. the way i usually put it is that the DFT (of which the FFT is a "fast" implementation) periodically extends the data passed to it. if i want to pick a fight, the way i put it is that the DFT (and iDFT) maps an infinite but periodic sequence of data in one domain (where the period is N, thus N values suffices to fully describe the infinite sequence) to another infinite and periodic sequence of the same period in the reciprocal domain.> >> Windows are frequently used to minimize discontinuity between the end of > >> Data and start of the next "copy" of Data. If you are using a 65536 point > >> rectangular window on a 65536 point data set, does it do anything?what is likely happening is that there is a windowing operation occuring when the 65536 samples are yanked out of a longer stream of samples before it is passed to the FFT. so there are effects of windowing (at least that of a rectangular window, usually the "worst" kind of window) before the FFT sees the data. but the fact is that the data is identical to that of a periodic sequence (with period equal to 65536) going unwindowed into the FFT. the results of the FFT are the same but interpreted differently, if you already know (or suspect) the difference regarding how those 65536 samples were obtained in the first place.> > His data samples are from a piano. I'm not sure if the > > most skilled pianist in the world could play a note exactly > > 65536 samples in length without requiring any windowing > > of the sound waveform.oh, but if the sampling frequency was low enough (say Fs=16384 Hz) and the note died to nothing in less than 65536/Fs seconds, it wouldn't matter.> > A dft does not "act" on its own.oh, we anthropomorphize all sorts of stuff. when we analyze a computer program with binary flags or semaphores, we can say things like "this routine expects the data set to be complete when the flag is set." it's appropriate to use the verb "act" just as it would be to use "process".> > It's only a complex vector > > transform whose results are up to interpretation.the DFT is an operation. an algorithm. a procedure. it can "act". the input and output to the DFT are vectors with possibly complex values.> True, but I think almost everyone here understands what I meant.i did.> I guess my point was that I have trouble with your equating "no window" with > a "rectangular window". There is no 0->1 or 1->0 transition in "no window", > it is a constant 1. The ft is an impulse; the dft is a pulse.the windowing happens before the DFT ever saw the data. unless you are passing to the DFT a representative cycle of a periodic sequence. r b-j
Reply by ●January 1, 20072007-01-01
robert bristow-johnson wrote:> > > A dft does not "act" on its own. > > oh, we anthropomorphize all sorts of stuff.The point is who you think is in charge. If you let dft act, you become helpless. If you act, either assuming the dft data was of periodic extent, or was most likely non-periodic, then you can get a result that better matches your assumptions about the data and the problem, instead of letting some dft make incorrect assumptions for you. Since tuning a piano strongly implies that the dft aperture has yanked the data out of a non-periodic stream, it's best not to assume that the data was periodic. The better assumption in this case is to assume the dft included a rectangular window and thus is contaminating the desired results with artifacts resulting from that window. Thus the dft is producing incorrect results. However these incorrect results to a more correct assumption may be more useful to the user than the correct results to the incorrect problem (which in some ways is like looking for your lost keys under the lights instead of where you think they might be). IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Reply by ●January 1, 20072007-01-01
Ron N. wrote:> robert bristow-johnson wrote: > > > > A dft does not "act" on its own. > > > > oh, we anthropomorphize all sorts of stuff. > > The point is who you think is in charge.i think that physical (or mathematical) reality is in charge.> If you let dft act, you become helpless.i don't think we have a choice. the math does what the math does. but we do have a choice in interpretation, which is what i think you're getting to here.> If you act, either assuming the dft data > was of periodic extent, or was most likely non-periodic, then > you can get a result that better matches your assumptions > about the data and the problem, instead of letting some dft > make incorrect assumptions for you.if you *know* in advance (if the DFT data is periodic) there is no assuming. if you don't, i think you're safer looking at it both ways. but either way is an assumption. i would be suspicious of periodicity with period N/4 if i saw every bin equal to virtually zero except those at multiples of 4. but if *could* have been some wild and crazy data that only looked that way after windowing.> Since tuning a piano strongly implies that the dft aperture > has yanked the data out of a non-periodic stream, it's best > not to assume that the data was periodic.i think you meant to say "periodic stream". but the period likely will not be a sub-multiple of N, so we can expect to see effects of windowing.> The better assumption in this case is to assume the dft > included a rectangular windowor better yet, that the rectangular window was applied to the stream of data before it was passed to the DFT (which periodically extended it).> and thus is contaminating > the desired results with artifacts resulting from that window.yup.> Thus the dft is producing incorrect results.but i wouldn't blame it on the DFT. i would blame it on the implicit windowing that happened before the DFT got the data.> However these > incorrect results to a more correct assumption may be more > useful to the user than the correct results to the incorrect > problem (which in some ways is like looking for your lost > keys under the lights instead of where you think they might be).we ain't as far apart on this as it may seem, Ron. r b-j






