DSPRelated.com
Forums

Calibrating FFT results, amplitude in to magnitude out

Started by Brian Willoughby March 25, 2011
On 2011/03/28 06:55, Jerry Avins wrote:
> On Monday, March 28, 2011 3:08:26 AM UTC-4, Brian Willoughby wrote: >> I cracked open Steiglitz' DPS Primer and the >> first example I came across translated sin(kwt) into e^(jkwt), without >> the negative frequency term. To be precise, he translates sin(kπt/T) >> with period of 2T into e^(jk2πt/T) with period of T, which is a little >> confusing in itself because of the change in period, but there you have it. > > When was that written? It was common in the 50s to ignore the e^-jwt and to
> fix things later with RE{} and IM{}. That puts a factor of 2 into the > magnitude, but period??? Are you sure? Maybe a typo? "A Digital Signal Processing Primer" was written in 1995 and copyrighted 1996. The author, Ken Steiglitz was born in 1939, so he might have learned the old ways. Thanks for the explanation of why the negative is needed, Jerry. It's no wonder that I'm having trouble refreshing what I learned in college when the texts I happen to be picking up as a reference are skipping important details! I'm sure that it's not a typo on my part. I started with a simple excerpt and almost skipped the details, but as I looked closer at the book I decided that I should literally transcribe what I saw. Confusing, indeed. I think I'm going to start picking up different texts for my research... Brian Willoughby Sound Consulting
On 2011/03/28 16:34, Greg Heath wrote:
> There are 3 widely used DFT normalizations (1/N,1,1/sqrt(N)). > > I prefer the 1st because cos(2*pi*f0*t) will yield 2 spikes > at +/-f0 of height 0.5. > > This is the test I use when encountering a new DFT/FFT > program. > > Hope this helps.
Thanks, Greg. It suddenly occurs to me that the Real-input FFT that is common in DSP libraries, and which drops the negative frequencies because they're symmetric for real-valued inputs, may be combining those two 0.5 spikes into a single 1.0 spike... I'm pretty sure I was already doing this, but I should test complex FFT and real FFT separately for calibration purposes. Brian Willoughby Sound Consulting
On 03/28/2011 11:38 PM, Jerry Avins wrote:
> Complex numbers marvelously simplify the math needed to describe > real things. The same is true for matrix algebra and vector > analysis. Complex numbers are the culmination of the progress of > computation that makes all operations close. Addition is closed for > positive integers -- the sum of two positive integers is a positive > integer -- but not for subtraction. Introducing negative numbers > closes subtraction. Multiplication is closed for integers -- the > product of two integers is an integer -- but not for division. > Introducing fractions closes division.
Yeah.
> And so on, until complex numbers are defined.
It's the "and so on" which I think you're missing.
> Then _all_ arithmetic operations close.
Really? What operations are you referring to? A field only has two operations: addition and multiplication. There is no such operations as subtraction and division. This is the role of *inverses* in algebra. The reals have all the nice properties you are intimating (translating inverses to the other two operations). So why can't they be the zero of any arbitrary polynomial over the reals? -- Randy Yates Digital Signal Labs 919-577-9882 http://www.digitalsignallabs.com yates@digitalsignallabs.com
I've been using imaginary numbers to represent phase shifts for about 60 years. Nothing in that time has led me to believe that phase shift is a (mathematically) imaginary phenomenon. It's simply a time lag, which, for periodic functions, is compactly expressed using phasors. 

Jerry
-- 
Engineering is the art of making what you want from things you can get.
On 3/28/2011 10:03 PM, glen herrmannsfeldt wrote:
> First, I 100% agree that many real quantities that should be as > cos(wt) are described as exp(iwt), such that they aren't actually > complex. >
I think that Jerry's point (does this become Fred's point?) is: Let us take the case of all signals in the real world. I'm tempted to include "functions" but I'm not good enough a mathematician to try that and the possibility of abstraction looms. Let us add the case of all sequences that can be expressed in the real world. OK, so there's our "universe" for discussion. If we use "real quantities that should be as cos(wt)" or could be at least and then we describe them as exp(iwt), the real thingy we're describing has not changed one bit. HOWEVER, the notation introduces complex numbers. These aren't "unreal" numbers, they aren't "ghostly" numbers but WE call them "imaginary" numbers. That's really an unfortunate term but it's one we're stuck with and leads to a lot of confusion because folks might say "if it's imaginary then it's not real". But "real" has the same contextual problem. There is "real" in the sense of being palpable, etc. and there is "real" as in the "real numbers" which has a very narrow definition. I think a good example is this: If I present you with a sequence of complex numbers is it "real/palpable" or is is "not real" such that you can't read it? Obviously you can read it so it's palpably real. The context or framework that makes the most sense to me is this: "real" numbers are numbers assigned on a 1-D axis/scale. "complex" numbers are numbers assigned on a 1-D axis/scale with is *orthogonal to* the "real" axis mentioned above. That does not make them any less palpably real, it's just "different than" how we have unfortunately labeled the first axis. What we do with this number system is up to us. So, if we decide that all "real" signals are those which only project on some real number axis or "in phase with cosines" that's just a choice we make for convenience. It doesn't have any other meaning - it's a point of reference (probably most often a reference in time for EE's). The clincher is this: The two axes above represent a plane and it's easy to constsruct a 3rd axis that is orthogonal to that plane, orthogonal to *both* the "real number axis" and the "imaginary number axis". What do we call this one? The "superimaginary axis"? Is lat/long/elevation any less real because we express it in 3-D? No. How do we deal with the superimaginaries? I rather like x,y and z and forget about real and imaginary all together. Real and imaginary are a throwback to a 2-D world. They are archaic terms reserved for elementary and middle school. If I remember right, we were introduced to roots of equations and learned that some were "real" and others were "complex". But that wording is shorthand for what should have been said: "Some roots fall on the real number axis and some roots fall on the "imaginary" number axis and some roots project on both axes. That doesn't say anything about real or imaginary in the palpability sense. They are all real and just have different lat/long/elev. Which is imaginary, lat or long? Fred
On Tue, 29 Mar 2011 10:31:14 -0700 (PDT), Jerry Avins <jya@ieee.org>
wrote:

>I've been using imaginary numbers to represent phase shifts for about 60 ye= >ars. Nothing in that time has led me to believe that phase shift is a (math= >ematically) imaginary phenomenon. It's simply a time lag, which, for period= >ic functions, is compactly expressed using phasors.=20 > >Jerry >--=20 >Engineering is the art of making what you want from things you can get.
For something like PSK signalling, though, the phase carries information. I suppose one may still look at it as a sort of instantaneous time lag, but it can start to get quirky at some point. Consider that OFDM systems use multiple carriers (often with PSK) and a full-complex DFT such that the complex-valued transform of the aggregated subcarriers is transmitted. That gets even weirder to wrap your head around when trying to think of it as a real-only signal. Eric Jacobsen http://www.ericjacobsen.org http://www.dsprelated.com/blogs-1//Eric_Jacobsen.php
On Mar 29, 1:31&#4294967295;pm, Jerry Avins <j...@ieee.org> wrote:
> I've been using imaginary numbers to represent phase shifts for about 60 years. Nothing in that time has led me to believe that phase shift is a (mathematically) imaginary phenomenon. It's simply a time lag, which, for periodic functions, is compactly expressed using phasors.
So you choose not to discuss it? You're absolutely certain there is nothing beyond your knowledge and/or viewpoint? --Randy
Fred Marshall <fmarshallxremove_the_x@acm.org> wrote:
> On 3/28/2011 10:03 PM, glen herrmannsfeldt wrote: >> First, I 100% agree that many real quantities that should be as >> cos(wt) are described as exp(iwt), such that they aren't actually >> complex.
> I think that Jerry's point (does this become Fred's point?) is:
> Let us take the case of all signals in the real world.
Some have generalized to all physical quantities. Now, what is and isn't a 'signal'?
> I'm tempted to include "functions" but I'm not good enough a > mathematician to try that and the possibility of abstraction looms. > Let us add the case of all sequences that can be expressed in the real > world.
Index of refraction makes sense as a function of frequency, but not as a function of time. Does that make it not a signal? I previoulsy mentioned the wikipedia page on Ellipsometry, which is an important application for complex index of refraction. (It happens that many useful materials have a very small imaginary part, but it isn't zero and can be important.) Also, for physical quantities and complex numbers see the wikipedia page for the Kramers-Kronig relation. (This should be applicable here, as it involves causality and Fourier transforms.)
> OK, so there's our "universe" for discussion.
> If we use "real quantities that should be as cos(wt)" or could be at > least and then we describe them as exp(iwt), the real thingy we're > describing has not changed one bit. > HOWEVER, the notation introduces complex numbers. These aren't "unreal" > numbers, they aren't "ghostly" numbers but WE call them "imaginary" > numbers. That's really an unfortunate term but it's one we're stuck > with and leads to a lot of confusion because folks might say "if it's > imaginary then it's not real".
As someone (maybe Jerry) said, there are no voltmeters to measure imaginary voltage, though we can measure voltage either as a function of time or voltage. Index of refraction (at least in the optical region) can only be measured as a function of frequency, not time. It only exists in quantities that go into an exponential, unlike voltage. (You can measure the square root of the dielectric constant at low frequencies, however.)
> But "real" has the same contextual problem. There is "real" in the > sense of being palpable, etc. and there is "real" as in the "real > numbers" which has a very narrow definition. > I think a good example is this: > If I present you with a sequence of complex numbers is it > "real/palpable" or is is "not real" such that you can't read it? > Obviously you can read it so it's palpably real.
> The context or framework that makes the most sense to me is this:
(snip) -- glen
Randy,

I don't have time to reply to your post in the depth it deserves. Please forgive me for deferring a reply.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
On 3/29/2011 12:26 PM, glen herrmannsfeldt wrote:
> Fred Marshall<fmarshallxremove_the_x@acm.org> wrote: >> On 3/28/2011 10:03 PM, glen herrmannsfeldt wrote: >>> First, I 100% agree that many real quantities that should be as >>> cos(wt) are described as exp(iwt), such that they aren't actually >>> complex. > >> I think that Jerry's point (does this become Fred's point?) is: > >> Let us take the case of all signals in the real world. > > Some have generalized to all physical quantities. Now, what > is and isn't a 'signal'?
***Not an issue for *me*. Include whatever you want.
> >> I'm tempted to include "functions" but I'm not good enough a >> mathematician to try that and the possibility of abstraction looms. >> Let us add the case of all sequences that can be expressed in the real >> world. > > Index of refraction makes sense as a function of frequency, > but not as a function of time. Does that make it not a signal?
***No. I tried to say "most of the time" EE's ,etc. Use frequency if you want.
> > I previoulsy mentioned the wikipedia page on Ellipsometry, > which is an important application for complex index of refraction. > (It happens that many useful materials have a very small imaginary > part, but it isn't zero and can be important.) > > Also, for physical quantities and complex numbers see the wikipedia > page for the Kramers-Kronig relation. (This should be applicable > here, as it involves causality and Fourier transforms.)
***Neither of these seem to be to the point. The first one certainly is about phase of a sinusoid which is just a reference point. The signals being measured remain real. Geez we sure know how to convolve things in the language we use!! What *is* a complex index of refraction anyway? Doesn't that just mean there's a phase shift and nothing more? There's nothing ghostly about that!
> >> OK, so there's our "universe" for discussion. > >> If we use "real quantities that should be as cos(wt)" or could be at >> least and then we describe them as exp(iwt), the real thingy we're >> describing has not changed one bit. >> HOWEVER, the notation introduces complex numbers. These aren't "unreal" >> numbers, they aren't "ghostly" numbers but WE call them "imaginary" >> numbers. That's really an unfortunate term but it's one we're stuck >> with and leads to a lot of confusion because folks might say "if it's >> imaginary then it's not real". > > As someone (maybe Jerry) said, there are no voltmeters to measure > imaginary voltage, though we can measure voltage either as a > function of time or voltage. Index of refraction (at least in the > optical region) can only be measured as a function of frequency, > not time. It only exists in quantities that go into an exponential, > unlike voltage. (You can measure the square root of the dielectric > constant at low frequencies, however.) > >> But "real" has the same contextual problem. There is "real" in the >> sense of being palpable, etc. and there is "real" as in the "real >> numbers" which has a very narrow definition. >> I think a good example is this: >> If I present you with a sequence of complex numbers is it >> "real/palpable" or is is "not real" such that you can't read it? >> Obviously you can read it so it's palpably real. > >> The context or framework that makes the most sense to me is this: > > (snip)
***Snip???? Fred