Magnitudes drop when adding more



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





.



Relevant Pages

  • Re: Magnitudes drop when adding more
    ... > 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 ... BUT the magnitudes are ... the normalization is up to you really. ...
    (comp.dsp)
  • Re: Magnitudes drop when adding more
    ... >> I was playing around with FFT a few years back and I think I ... BUT the magnitudes are ... >> But in my application, the more tones I add, the lower they ALL get. ... the normalization is up to you really. ...
    (comp.dsp)
  • Re: About FFT bins
    ... the tones? ... DSP Consultant ... after do FFT we have: ... Further decimation will allow smaller FFTs with the same ...
    (comp.dsp)
  • Re: FFT Spectrum Analyzer using Digitizer
    ... loading with 3 cosine tones in the I channel: one at 14.0 MHz, ... I give each of these tones some phase, ... I acquire the signal and take the FFT in Matlab. ... signals, and what I discovered was that if you are not EXACT in your ...
    (comp.dsp)
  • Re: Spectrum analysis question
    ... better for us to average FFT magnitudes or average the squares of the ... disappear by offsetting the FFT frames so that the signal ... out across frames due to phase rotation. ...
    (comp.dsp)