Magnitudes drop when adding more
- From: "overgaard" <jorgen@xxxxxxxxxxxxx>
- Date: Sun, 29 Jan 2006 07:19:15 -0600
Hi,
I've just "restarted" my interest in DSP and mainly FFT.
I'm using FFTW which I think is absolutely amazingly good! :)
I was playing around with FFT a few years back and I think I
remember stumbled on this problem back then too. The sad
part is - I don't remember if I solved it or not back then.
(what good memory, eh? hehe)
Anyway, I'm troubled with something I quite can't figure out.
I've done a test application that generates sinewaves and stores them
to a WAV-file. When I open the WAV-file and run FFTW on it and plot
a spectrum of it, it looks fine on frequency. BUT the magnitudes are
behaving strangely. If I have a single tone, lets say at 1000 Hz
it show up at full scale. If I add one more tone, they BOTH drop in
magnitude. To doublecheck I opened the WAV file i Audacity and looked att
the spectrum there. It looks fine there even if I add three tones or
more.
But in my application, the more tones I add, the lower they ALL get.
Why is this? (ripping the hair of my head)
I'm using real to complex FFTW, eg. fftw_plan_dft_r2c_1d
and I am calculating the magnitudes with
sqrt((in_complex[i][0]*in_complex[i][0])+(in_complex[i][1]*in_complex[i][1]))*Normalize
which should translate to
Magnitude = sqrt(re^2 + im^2) * Normalize
My normalizing is
Normalize = (sqrt(1.0/FFT_SIZE)) * (sqrt(1.0/FFT_SIZE));
I've tried a lot of "normalizers" (searched Comp.DSP) but I'm not a 100
percent sure this is the "right" normalizing.
Anyone has any idea why the magnitudes drop the more tones I add?
And of course, please tell me something about how to normalize correctly.
If I have a sine at 1000 Hz which peaks(-1.0 to 1.0) it would be
nice to get the spectrum to show about 1.0 in magnitude at the bin
for 1000 Hz.
Best regards // Jörgen
.
- Follow-Ups:
- Re: Magnitudes drop when adding more
- From: Rune Allnor
- Re: Magnitudes drop when adding more
- From: Fred Marshall
- Re: Magnitudes drop when adding more
- Prev by Date: multipath over sea for radar
- Next by Date: Re: multipath over sea for radar
- Previous by thread: multipath over sea for radar
- Next by thread: Re: Magnitudes drop when adding more
- Index(es):
Relevant Pages
|