COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Calibrating FFT results, amplitude in to magnitude out

• Email
• Follow

Hello all,

There is one factor that seems to be missing from texts which describe
the DFT/FFT (or perhaps I have missed it).  That is: The correlation
between time domain signal amplitude and frequency domain bin magnitudes.

On the one hand, many DSP libraries are very meticulous about
documenting the differences between their FFT or IFFT implementation
results versus Matlab.  For example, one implementation of an N-point
FFT might require that the results be divided by N to correlate with the
Matlab results, while another implementation would produce the exact
results without further calculations.  Even though I don't use Matlab,
these sorts of issues make sense to me as an expected side effect of
certain code optimizations.

What I haven't found in the general texts is mention of the values I
should expect if I plug sin() at a constant frequency into a time domain
array and calculate the FFT.  Should I expect one frequency magnitude
bin to have a value of 1.0 because the sin() function varies between
-1.0 and +1.0? ... or would the magnitude bin be expected to hold a
value of 2.0 because the peak-to-peak amplitude of sin() is actually 2.0
(+1.0 - -1.0)?  I am asking specifically about sin() frequencies which
fall precisely into a frequency bin based on the FFT size.  The general
case would obviously be more complicated due to potential frequency
smearing.

The reason I ask is that Apple's Accelerate/vecLib Framework seems to be
returning 2.0 when I carefully construct time domain test signals with
'unity' amplitude, and for some reason I was expecting 1.0 ... so what's

By the way, my test code is taking the additional step of converting the
complex FFT results from their real and imaginary components into
magnitude (and phase - which should be optional).

I also have a slightly related question: I assume that if the real and
imaginary components never exceed +/-1.0, then the magnitude could not
possibly be greater than 1.4142, but I also have a feeling that the
nature of the FFT is that the results should probably never produce a
magnitude greater than 1.0, because the real and imaginary components
are not completely random - i.e. a given pair of real and imaginary
components would never both be +1.0 or -1.0 unless something terribly
unnatural had occurred.  Again, assuming that the time-domain signal
does not exceed +/-1.0 (and I realize that is not always the case with
uncontrolled inputs).

Brian Willoughby
Sound Consulting

P.S.  I'm sure that I'll happen across one of my texts that does spell
this out, now that I've gone to the trouble of writing the question.
But I do not that I've gone looking for a reference on more than one
occasion and came up with nothing.
 0
Reply Brian 3/25/2011 1:50:30 PM

See related articles to this posting

When I was introduced to the continuous Fourier transform and its inverse, =
there was a 1/sqrt(N) in front of each integral. Later, I ran across others=
in which one integral was left "raw", and the other divided by N. Dividing=
either the direct or inverse transform works out to be simplest for a part=
icular application, but it seems to me that dividing each by the square roo=
t has only symmetry and aesthetics to recommend it.

Personally, I usually prefer the form where the frequency-domain coefficien=
ts coincide with the peak amplitudes of the components. That is, for a squa=
re wave of amplitude +/-1 and frequency w=3D2*pi*f, the components are
(4/pi)*[sin(w) + sin(3*w)/3 + sin(5w)/5 + ...].

Needless to say, this applies also to DFT summations.

Jerry
--=20
Engineering is the art of making what you want from things you can get.
 0
Reply Jerry 3/25/2011 2:22:16 PM

On Mar 25, 9:50=A0am, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:
> Hello all,
>
> There is one factor that seems to be missing from texts which describe
> the DFT/FFT (or perhaps I have missed it). =A0That is: The correlation
> between time domain signal amplitude and frequency domain bin magnitudes.
>
> On the one hand, many DSP libraries are very meticulous about
> documenting the differences between their FFT or IFFT implementation
> results versus Matlab. =A0For example, one implementation of an N-point
> FFT might require that the results be divided by N to correlate with the
> Matlab results, while another implementation would produce the exact
> results without further calculations. =A0Even though I don't use Matlab,
> these sorts of issues make sense to me as an expected side effect of
> certain code optimizations.
>
> What I haven't found in the general texts is mention of the values I
> should expect if I plug sin() at a constant frequency into a time domain
> array and calculate the FFT. =A0Should I expect one frequency magnitude
> bin to have a value of 1.0 because the sin() function varies between
> -1.0 and +1.0? ... or would the magnitude bin be expected to hold a
> value of 2.0 because the peak-to-peak amplitude of sin() is actually 2.0
> (+1.0 - -1.0)? =A0I am asking specifically about sin() frequencies which
> fall precisely into a frequency bin based on the FFT size. =A0The general
> case would obviously be more complicated due to potential frequency
> smearing.
>
> The reason I ask is that Apple's Accelerate/vecLib Framework seems to be
> returning 2.0 when I carefully construct time domain test signals with
> 'unity' amplitude, and for some reason I was expecting 1.0 ... so what's
> the 'right' answer?
>
> By the way, my test code is taking the additional step of converting the
> complex FFT results from their real and imaginary components into
> magnitude (and phase - which should be optional).
>
> I also have a slightly related question: I assume that if the real and
> imaginary components never exceed +/-1.0, then the magnitude could not
> possibly be greater than 1.4142, but I also have a feeling that the
> nature of the FFT is that the results should probably never produce a
> magnitude greater than 1.0, because the real and imaginary components
> are not completely random - i.e. a given pair of real and imaginary
> components would never both be +1.0 or -1.0 unless something terribly
> unnatural had occurred. =A0Again, assuming that the time-domain signal
> does not exceed +/-1.0 (and I realize that is not always the case with
> uncontrolled inputs).
>
> Brian Willoughby
> Sound Consulting
>
> P.S. =A0I'm sure that I'll happen across one of my texts that does spell
> this out, now that I've gone to the trouble of writing the question.
> But I do not that I've gone looking for a reference on more than one
> occasion and came up with nothing.

Hello Brian,

You've ventured into an area where things are done in more than one
way. Most commonly done is the DFT(FFT) has a gain of N/2 where is is
the "size" of the DFT(FFT). This gain results when no scale factor is
applied to the direct DFT(FFT) process. Then the inverse DFT(FFT) will
end up being multiplied by 2/N to make the round trip gain equal to
one. But I know of at least one case where both the forward and
inverse DFTs(FFTs) are multiplied by sqrt(2/N) to impart a sort of
symmetry to the computational process. A simple test of transforming a
sinusoid whose frequency is one of the bin frequencies (avoids
leakage) and seeing what the gain is will tell you what gain your
process has.

But from the defn of a DFT and applying it to a sinusoid on bin
frequency will show you where the gain of N/2 comes from.

IHTH,
Clay

 0
Reply Clay 3/25/2011 2:26:00 PM

On 2011/03/25 07:26, Clay wrote:
> You've ventured into an area where things are done in more than one
> way. Most commonly done is the DFT(FFT) has a gain of N/2 where is is
> the "size" of the DFT(FFT). This gain results when no scale factor is
> applied to the direct DFT(FFT) process. Then the inverse DFT(FFT) will
> end up being multiplied by 2/N to make the round trip gain equal to
> one. But I know of at least one case where both the forward and
> inverse DFTs(FFTs) are multiplied by sqrt(2/N) to impart a sort of
> symmetry to the computational process. A simple test of transforming a
> sinusoid whose frequency is one of the bin frequencies (avoids
> leakage) and seeing what the gain is will tell you what gain your
> process has.
>
>
> But from the defn of a DFT and applying it to a sinusoid on bin
> frequency will show you where the gain of N/2 comes from.

Is that what Matlab produces?

I must admit that I haven't been able to justify the cost of a Matlab
license, and thus I've never used it.  Yet Apple and Texas Instruments
seem to define their FFT libraries in terms of how Matlab does things.
I always assumed that Matlab was producing the results as defined by the
DFT, regardless of whether it was 'efficient' for the given processor,
where Apple and TI are interested in implementations which take the
fewest cycles, and thus may end up with a different scaling.

Yours comments leave me thinking that a sinusoid with an amplitude of 1
(or a range of +/-1) should have a different bin magnitude for each FFT
size.

P.S.  Another related question is what to expect from impulse response
and step response inputs.  I'm inclined to synthesize an impulse as a
single +1.0 sample followed by 0.0 samples to pad out the FFT size.
Similarly, a step input would be a 0.0 sample followed by +1.0 samples
to pad out the FFT size.  In both cases, I would hope that the output is
limited to +1.0 in each bin magnitude, unless the system under test has
overshoot, ringing, resonance, or something like that.  e.g., I should
be able to test the frequency response of an unknown process by sending
an impulse to the input and then calculating an FFT on the output.  A
'flat' frequency response would then be expected as  bins with +1.0 at
every frequency.  Have I got the calibration right?

Brian Willoughby
Sound Consulting
 0
Reply Brian 3/27/2011 1:29:13 PM

On Mar 27, 9:29=A0am, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:

....
>  =A0Another related question is what to expect from impulse response
> and step response inputs. =A0I'm inclined to synthesize an impulse as a
> single +1.0 sample followed by 0.0 samples to pad out the FFT size.
> Similarly, a step input would be a 0.0 sample followed by +1.0 samples
> to pad out the FFT size. =A0In both cases, I would hope that the output i=
s
> limited to +1.0 in each bin magnitude, unless the system under test has
> overshoot, ringing, resonance, or something like that. =A0e.g., I should
> be able to test the frequency response of an unknown process by sending
> an impulse to the input and then calculating an FFT on the output. =A0A
> 'flat' frequency response would then be expected as =A0bins with +1.0 at
> every frequency. =A0Have I got the calibration right?

Brian,

this is a very similar issue to the one posted by Andy365 in the
thread: "Energy in a signal as a function of sampling".

there is a well-defined answer for both of you.  or maybe a couple of
different answers that will get you to the same place.

the way i dealt with this when i was in college and using the computer
to do FFTs and such on data that (in simulation) came from a known
source, was to compare the Discrete Fourier Transform (however it's
defined, whether it has a 1, a 1/N, or a sqrt(1/N) in front) to a
Riemann Summation of the Fourier Integral.

the other way i can think of is to simply define a unit sinusoid, bust
it into a positive frequency e^(jwn) and a negative frequency
component, e(-jwn), and stuff that into the DFT and see what comes
out.  if w =3D 2*pi*k/N for integer k, it will come out real clean and
you will know how large the number in the FFT bin is for a unit-
amplitude sine.

r b-j
 0
Reply robert 3/28/2011 3:21:22 AM

On 2011/03/27 20:21, robert bristow-johnson wrote:
> the way i dealt with this when i was in college and using the computer
> to do FFTs and such on data that (in simulation) came from a known
> source, was to compare the Discrete Fourier Transform (however it's
> defined, whether it has a 1, a 1/N, or a sqrt(1/N) in front) to a
> Riemann Summation of the Fourier Integral.
>
> the other way i can think of is to simply define a unit sinusoid, bust
> it into a positive frequency e^(jwn) and a negative frequency
> component, e(-jwn), and stuff that into the DFT and see what comes
> out.  if w = 2*pi*k/N for integer k, it will come out real clean and
> you will know how large the number in the FFT bin is for a unit-
> amplitude sine.

Thanks for the response.

I hope I don't seem lazy, but I was hoping to just get the answer.  ;-)
I don't mind also knowing how to independently derive said answer.

In college, I remember (thinking) that I understood all of those
formulae with 'e' and found them to be a beautiful expression of the
symmetry of nature.  These days, I have forgotten quite a bit of that,
assuming I really ever had it right.  Now I tend to only understand the
direct and practical application rather than the theoretical proofs.
Actually, I've never been able to just look at a formula like e^(j2πf/T)
and 'know' what its integral would be.  I tend to depend upon the math
types to tell me what it works out to be.

That said, if I make an attempt to follow what you wrote above, I find
myself asking why you translate a sinusoid into both e^(jwn) and
e^(-jwn) ... wouldn't that put double the signal in?  Do you really need
both the negative and positive frequencies for a real-valued sinusoid
input?  Why wouldn't a pure real sinusoid simply translate to the
positive frequency only?  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.

In any event, lately I've been finding myself wishing that someone could
write a book on DSP which uses plain English at a somewhat high level to
introduce each concept, even if there is still a followup mathematical
proof to back up the claims.  But I'd like it organized so that I could
easily skip the proof until I need to know it and understand it.  Every
text I've seen seems to start with the math, but that ends up stretching
out the description long enough that it's harder to follow unless you
already understand the math.  Sort of counterproductive.  I'm not saying
that some understanding of the math is not useful or even necessary, but
I also have a feeling that some of these concepts could easily be
described to 90% of the necessary level of detail without too much math,
at least by someone gifted in writing (yes, an admittedly rare trait
among engineers and scientists, not to mention mathematicians).  I think
Hal Chamberlin's "Musical Applications of Microprocessors" was the last
time I sat down for some light reading in plain English and found myself
in an "a ha, this all makes sense on a deeper level, now" kind of
moment.  Of course, only an engineer would consider that book to be
light reading, but I find it a lot lighter than the mathematical texts.

Anyway, sorry for the rambling, but my original question remains: Can
anyone just spell out the answer in simple terms?  Two very helpful
individuals have replied in this thread, but basically suggested that I
derive my answer by manually calculating the DFT.  That's an intriguing
challenge, but my initial goal was to find a confirmed reference that I
could use to test my code against (and the library code that I am
using), and thus I feel like if I derive the answer myself then I would
still have some doubt.  Actually, I'm refining some old code where I
thought I had all of these calibrations figured out, and now I'm having
doubts, thus the request for a solid answer.

P.S.  Who is Riemann?  I never heard of him before.  Actually, scratch
my literal question, because Wikipedia has the answer.  They even
mention Fourier in the article...

Brian Willoughby
Sound Consulting
 0
Reply Brian 3/28/2011 7:08:26 AM

On Mar 25, 3:50=A0pm, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:

> What I haven't found in the general texts is mention of the values I
> should expect if I plug sin() at a constant frequency into a time domain
> array and calculate the FFT. =A0Should I expect one frequency magnitude
> bin to have a value of 1.0 because the sin() function varies between
> -1.0 and +1.0? ... or would the magnitude bin be expected to hold a
> value of 2.0 because the peak-to-peak amplitude of sin() is actually 2.0
> (+1.0 - -1.0)? =A0I am asking specifically about sin() frequencies which
> fall precisely into a frequency bin based on the FFT size. =A0The general
> case would obviously be more complicated due to potential frequency
> smearing.

Those are two questions, and thus they have two answers.

First, assume the sinusoidal has a frequency that coincides
with a DFT coefficient. In that case, it is common to define
the DFT such that the DFT coefficient is N times as large as
the amplitude of the sinusoidal, where N is the DFT length.
There is an 1/N assymetry in the scaling coefficinets of the
DFT and IDFT, such that (formally) IDFT(DFT(x[n])) =3D x[n].

The second case is when the frequency of the sinusoidal does
*not* coincide with a DFT coefficnet. In this case all the
issues regarding scaling as considered in case 1 still applies,
along with the frequency smearing issues.

Rune
 0
Reply Rune 3/28/2011 7:18:49 AM

On 2011/03/28 00:18, Rune Allnor wrote:
> On Mar 25, 3:50 pm, Brian Willoughby
> <Sound_Consulting-...@Sounds.wa.com>  wrote:
>
>> What I haven't found in the general texts is mention of the values I
>> should expect if I plug sin() at a constant frequency into a time domain
>> array and calculate the FFT.  Should I expect one frequency magnitude
>> bin to have a value of 1.0 because the sin() function varies between
>> -1.0 and +1.0? ... or would the magnitude bin be expected to hold a
>> value of 2.0 because the peak-to-peak amplitude of sin() is actually 2.0
>> (+1.0 - -1.0)?  I am asking specifically about sin() frequencies which
>> fall precisely into a frequency bin based on the FFT size.  The general
>> case would obviously be more complicated due to potential frequency
>> smearing.
>
> Those are two questions, and thus they have two answers.
>
> First, assume the sinusoidal has a frequency that coincides
> with a DFT coefficient. In that case, it is common to define
> the DFT such that the DFT coefficient is N times as large as
> the amplitude of the sinusoidal, where N is the DFT length.
> There is an 1/N assymetry in the scaling coefficinets of the
> DFT and IDFT, such that (formally) IDFT(DFT(x[n])) = x[n].
>
> The second case is when the frequency of the sinusoidal does
> *not* coincide with a DFT coefficnet. In this case all the
> issues regarding scaling as considered in case 1 still applies,
> along with the frequency smearing issues.

Thanks.  I realize that it's basically two questions, and I was
attempting to exclude the second question.

Getting back to it, I think that part of what I am missing is experience
with Matlab.  Both Apple and Texas Instruments seem intent to describe
their FFT library in terms of how the results compare to Matlab's
results.  That's where I get a little lost.

In your answer, you refer to DFT coefficients.  Would that be the same
as the FFT bins in the result?

You mention that the DFT coefficient is N times as large as the
amplitude of the sinusoid, but I would interpret that to mean that if I
send in a +/-1.0 sin() at a nice frequency for a 128-point FFT, then I
would see +128 in the result bin for that frequency (or maybe +256).
What's confusing, though, is that Texas Instruments claims their
unscaled FFT produces 1/N results compared to Matlab.  i.e. you must
multiply the Matlab results by N to compare to the TI DSPLIB results.
This seems entirely opposite of what you describe.  Meanwhile, TI says
that their scaled FFT produces the exact same results as Matlab, which
doesn't really tell me anything since I'm unfamiliar with Matlab.  The
reason I'm confused is that your description implies (to me) that I
would need to divide by N to get the calibrated results that I want, and
yet TI only mentions multiplying by N or leaving the values alone.  Some
piece here doesn't jibe with the rest.

P.S.  I assume that, when the input frequency does not coincide exactly
with a DFT coefficient, the magnitude of the results for unaligned
signal frequencies will be less than or almost equal to the aligned
frequency results.  In other words, I assume that the energy of the
signal is diminished by being spread out over multiple bins.

Brian Willoughby
Sound Consulting
 0
Reply Brian 3/28/2011 7:42:20 AM

On Mar 28, 9:42=A0am, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:

> You mention that the DFT coefficient is N times as large as the
> amplitude of the sinusoid,

Use x[n] =3D exp(j 2*pi*q/N), q and N integers, q < N/2.

Then (view with fixed-width font)

N-1
X[k] =3D sum exp(j2pi q/N) exp(-j2pi k/N)
n=3D0

If q =3D/=3D k then X[k] =3D=3D 0. When q =3D=3D k then

N-1                                 N-1
X[k] =3D sum exp(j2pi k/N) exp(-j2pi k/N)  =3D sum 1 =3D N.
n=3D0                                 n=3D0

So the DFT coefficient X[q] has N times as large amplitude
as the sinusoidal x[n].

Do note the 1/N factor in the expression for the IDFT.

Rune
 0
Reply Rune 3/28/2011 8:39:24 AM

On Mar 28, 3:08=C2=A0am, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:
> On 2011/03/27 20:21, robert bristow-johnson wrote:
>
> > the way i dealt with this when i was in college and using the computer
> > to do FFTs and such on data that (in simulation) came from a known
> > source, was to compare the Discrete Fourier Transform (however it's
> > defined, whether it has a 1, a 1/N, or a sqrt(1/N) in front) to a
> > Riemann Summation of the Fourier Integral.
>
> > the other way i can think of is to simply define a unit sinusoid, bust
> > it into a positive frequency e^(jwn) and a negative frequency
> > component, e(-jwn), and stuff that into the DFT and see what comes
> > out. =C2=A0if w =3D 2*pi*k/N for integer k, it will come out real clean=
and
> > you will know how large the number in the FFT bin is for a unit-
> > amplitude sine.
>
> Thanks for the response.
>
> I hope I don't seem lazy, but I was hoping to just get the answer. =C2=A0=
;-)
> I don't mind also knowing how to independently derive said answer.
>
> In college, I remember (thinking) that I understood all of those
> formulae with 'e' and found them to be a beautiful expression of the
> symmetry of nature. =C2=A0These days, I have forgotten quite a bit of tha=
t,
> assuming I really ever had it right. =C2=A0Now I tend to only understand =
the
> direct and practical application rather than the theoretical proofs.
> Actually, I've never been able to just look at a formula like e^(j2=CF=80=
f/T)
> and 'know' what its integral would be. =C2=A0

Don't worry, nobody can, not even Euler or Gauss. You can derive it,
but not intitutively do it. (Or one
can pretend by talking in axiomatic circles I suppose)

Anyway, given a sine wave with peak value of 1 Volt, a 4 point DFT of
the sine wave is

(sin(0)*sin(0) + sin(pi/2)*sin(pi/2) + sin(pi)sin(pi) +
sin(3/2pi)*sin(3/2pi))
=3D (0 + 1+ 0 + 1) =3D 2

(sin(0)*cos(0) + sin(pi/2)*cos(pi/2) + sin(pi)cos(pi) +
sin(3/2pi)*cos(3/2pi))
=3D (0 + 0 + 0 + ) =3D  0

bin magnatide =3D sqrt(2^2+0^2)=3D2

so you get 2 for the bin peak voltage result which is a N/2  =3D 4/2 =3D 2
gain
 0
Reply steve 3/28/2011 7:25:40 PM

On Mar 25, 9:50=A0am, Brian Willoughby
<Sound_Consulting-...@Sounds.wa.com> wrote:
> Hello all,
>
> There is one factor that seems to be missing from texts which describe
> the DFT/FFT (or perhaps I have missed it). =A0That is: The correlation
> between time domain signal amplitude and frequency domain bin magnitudes.
>
> On the one hand, many DSP libraries are very meticulous about
> documenting the differences between their FFT or IFFT implementation
> results versus Matlab. =A0For example, one implementation of an N-point
> FFT might require that the results be divided by N to correlate with the
> Matlab results, while another implementation would produce the exact
> results without further calculations. =A0Even though I don't use Matlab,
> these sorts of issues make sense to me as an expected side effect of
> certain code optimizations.
>
> What I haven't found in the general texts is mention of the values I
> should expect if I plug sin() at a constant frequency into a time domain
> array and calculate the FFT. =A0Should I expect one frequency magnitude
> bin to have a value of 1.0 because the sin() function varies between
> -1.0 and +1.0? ... or would the magnitude bin be expected to hold a
> value of 2.0 because the peak-to-peak amplitude of sin() is actually 2.0
> (+1.0 - -1.0)? =A0I am asking specifically about sin() frequencies which
> fall precisely into a frequency bin based on the FFT size. =A0The general
> case would obviously be more complicated due to potential frequency
> smearing.
>
> The reason I ask is that Apple's Accelerate/vecLib Framework seems to be
> returning 2.0 when I carefully construct time domain test signals with
> 'unity' amplitude, and for some reason I was expecting 1.0 ... so what's
> the 'right' answer?
>
> By the way, my test code is taking the additional step of converting the
> complex FFT results from their real and imaginary components into
> magnitude (and phase - which should be optional).
>
> I also have a slightly related question: I assume that if the real and
> imaginary components never exceed +/-1.0, then the magnitude could not
> possibly be greater than 1.4142, but I also have a feeling that the
> nature of the FFT is that the results should probably never produce a
> magnitude greater than 1.0, because the real and imaginary components
> are not completely random - i.e. a given pair of real and imaginary
> components would never both be +1.0 or -1.0 unless something terribly
> unnatural had occurred. =A0Again, assuming that the time-domain signal
> does not exceed +/-1.0 (and I realize that is not always the case with
> uncontrolled inputs).
>
> Brian Willoughby
> Sound Consulting
>
> P.S. =A0I'm sure that I'll happen across one of my texts that does spell
> this out, now that I've gone to the trouble of writing the question.
> But I do not that I've gone looking for a reference on more than one
> occasion and came up with nothing.

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.

Greg

Hope this helps.
 0
Reply heath (3990) 3/28/2011 11:34:00 PM

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
 0
Reply 3/29/2011 10:49:26 AM

11 Replies
450 Views

Similar Articles

12/9/2013 4:24:56 AM
page loaded in 222804 ms. (0)

Similar Artilces:

Out of Memory #41
Hi, This is the error message i get when I run a code. ------------------------------------------------------------------------------------- >> [X,Y,Z]=meshgrid(x,y,z); ??? Out of memory. Type HELP MEMORY for your options. Error in ==> meshgrid at 60 xx = xx(ones(ny,1),:,ones(nz,1)); ------------------------------------------------------------------------------------ x,y,z are vectors with 1 column 10201 rows. I am trying to meshgrid them and use a matlab toolbox to get an STL file out of this data. Any help is appreciated. Thank You "Deepak " <deepak.tss@gmail.com> wrote in message <jomo87\$mio\$1@newscl01ah.mathworks.com>... > > x,y,z are vectors with 1 column 10201 rows. > > I am trying to meshgrid them and use a matlab toolbox to get an STL file out of this data. =============== Figure out another way. The error is not surprising because each of X,Y,Z would need to contain 8*10201^3 = about 10TB

Re: Out of Office
tmuir@RDG.BOEHRINGER-INGELHEIM.COM wrote: >Hi, > >I'm out of the office until 2008. In the interim, I suggest adding a rule >to >your email application to deposit these auto replies in an appropriate >place. > >Sorry for any inconveniences or email server overloads during the new year, >and please... Have a Happy New Year! > >Best Regards, >Tim Out until 2008 ?!?!?!?! Wow, that's some vacation plan! HTCT, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 _________________________________________________________________ Visit MSN Holiday Challenge for your chance to win up to \$50,000 in Holiday cash from MSN today! http://www.msnholidaychallenge.com/index.aspx?ocid=tagline&locale=en-us

chronological order of JInternalFrames
Hi! I want to build a "Window" menu with the functions "Next Window" and "Previous Window" which select the next or previous opened internal frame (in the order as they were opened). To implement these methods I need the opened internal frames of the desktopPane in the same order as they were opened. It seems to me that the getAllFrames()-Method of the JDesktopPane returns the internal frames in the order of the last activation (with the last selected at first), but not in chronological order. How can I get an ordered Array of JInternalFrames? Thanks in advan

EOF calculation
file name assigned to i= t, so the loop goes through one more iteration.=20 Now the #filenames returns a blank value as all the files are read and I e= nd up with a error in the #fileinfo command. I tried using a DO WHILE loop, but there again I need to enter the loop wit= h fnames as blank value and have to exit again with fnames as blank (the on= ly way I can know that I have reached the end of the file list). I also tried to figure out the total number of files and use it in my loop = but that seems to be too much of work. Any help on this would be appreciated. That's commonly... can know that I have reached the end of the > file list). > > I also tried to figure out the total number of files and use it in my > loop but that seems to be too much of work. > > Any help on this would be appreciated. Hari wrote: > There already exisits a older topic that I started for this but it started off with a different topic and ended up in EOF. So inorder to spare you guys from all the unrelated posts I am starting it again. But trust me this is not a duplicate as the approach I am discussing here is new > > So here is what I am trying to do. I needed

Deferred: Connection timed out with...
Yesterday I sent 4 messages to external addresses and all 4 came back with: Deferred: Connection timed out with ... Apparently much later that evening they were all delivered successfully. The destinations included mit.edu, gmail.com and other well managed sites, so I am thinking it must be our fault. Our internet link was saturated at the time, but I received plenty of incoming mail and I didn't notice any problems with the web, etc. Does this message point to any particular timeout parameter? Should I try increasing it? I had the impression that SMTP worked well over saturated links. We are doing more anti-spam/anti-virus than we used to, including Spamassassin in a milter. Should we be excluding outbound mail? Daniel Feenberg. feenberg isat nber dotte org In article <1186490281.035219.196480@22g2000hsm.googlegroups.com>, "drfremove@nber.org" <feenberg@gmail.com> wrote: > Yesterday I sent 4 messages to external addresses and all 4 came back > with: > > Deferred: Connection timed out with ... > > Apparently much later that evening they were all delivered > successfully. The destinations included mit.edu, gmail.com

std::vector and a bit-wise copy
of memory trampling and > exhibit UB. > > Is that wrong or am I missing something w.r.t. the bit-wise copy? If some low-level operation (e.g. memcpy) would happen here, this would indeed be a problem, but the language guarantees that it does not happen here. Maybe you are mixing here two different concepts? Some types are trivially copyable (e.g. scalar types like int), where a specified usage of memcpy and similar operations leads to well-defined results, but the language doesn't say that the implicitly defined copy- constructor does a memcpy operation. HTH &

Re: To find out the max value...
On Thu, Jan 1, 2009 at 6:35 AM, SUBSCRIBE SAS-L Joe H. Smith < peesari.mahesh@gmail.com> wrote: > Hi all, > > I have data like this..... > > Name a b c d e f > Mahi 12 45 65 87 36 98 > Suri 32 20 54 86 47 100 > Nari 05 62 28 65 46 32 > > I should get the o/p max of only two highest no's... > > Name max1 max2 > Mahi 98 87 > Suri 100 86 > Nari 65 62 > > Can anyone please provide me the code as how to find max of an > observation.. > > > Thanx. > SASPROC > Hi, data have; input

P-M machine with DVI output?
Hi All, Forgive me if this gets asked a lot: does anyone know of a Centrino chipset (with whatever 802.11blah, doesn't matter), Pentium-M class laptop that has a DVI output port for connection to an external monitor? (Apple alptops have had this feature for a few years, but I need DVI out and Windows XP for a particular app). Thanks, -p plated metal <ha@yeah.right> wrote in message news:<3fd3b4dd\$1@duster.adelaide.on.net>... > does anyone know of a Centrino > chipset (with whatever 802.11blah, doesn't matter), Pentium-M class > laptop that has a DVI... need DVI out > and Windows XP for a particular app). > > Thanks, > > -p > Duncan James Murray wrote: > IBM T40p/T41p Not quite. Quoting the support docs: "Support for a DVI monitor is through the ThinkPad Dock II option and is limited to a resolution of 1280 x 1024 at 60 Hz." -p > Duncan. > > "plated metal" <ha@yeah.right> wrote in message > news:3fd3b4dd\$1@duster.adelaide.on.net... > >>Hi All, >> >>Forgive me if this gets asked a lot: does anyone know of a Centrino >>chipset (with whatever

Break out instances to different ports
We have three instances of Oracle on one machine under the same port (1521). I would like to break the TEST and DEV instances out to their own ports. What needs to be done? It is possible to take PROD down for a short period. However, PROD needs to stay just the way it is with no changes. Here's our listener.ora config: # listener.ora Network Configuration File: /app/oracle/product/oradata/ network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /app/oracle/product...;ken.holm@holmcc.com" <ken.holm@holmcc.com> wrote: >We have three instances of Oracle on one machine under the same port >(1521). I would like to break the TEST and DEV instances out to their >own ports. Why ? As an exercise on futility? Because you have too much time on your hands? Shouldn't you rather make sure TEST and DEV are on different servers? -- Sybrand Bakker Senior Oracle DBA Comments embedded. On Apr 4, 4:28 pm, "ken.h...@holmcc.com" <ken.h...@holmcc.com> wrote: > We have three instances of Oracle on one machine under the same port >

Fallout 4 News
had spent more time alone with my computer.' ~Dan(i) Bunten On Tue, 18 Jun 2013 22:13:49 +0100, "Trimble Bracegirdle" <no-spam@never.spam> wrote: >Thanks to Blue's News: >http://www.bubblews.com/news/660463-fallout-4-announcement I LOVED Fallout 3 and played through all of the DLC. When New Vegas came out I played it to I would guess half way and dropped it in favour of other releases. I never could get back in to it as newer games always seemed to have more polish, looked better, played better etc. A shame really. I hope this is more than just more of the same. Memnoch <memnoch@nospampleaseimbritish.ntlworld.com> looked up from reading the entrails of the porn spammer to utter "The Augury is good, the signs say: >On Tue, 18 Jun 2013 22:13:49 +0100, "Trimble Bracegirdle" <no-spam@never.spam> >wrote: > >>Thanks to Blue's News: >>http://www.bubblews.com/news/660463-fallout-4-announcement > > >I LOVED Fallout 3 and played through all of the DLC. When New Vegas came out I >played it to I would guess half way and dropped it in favour of other >releases