On Wed, Nov 4, 2015 at 10:56 AM, Phil Burk <philb...@mobileer.com> wrote:
> What is the "right" way to scale the inputs of an FFT.
>
> I have implemented some FFT functions in JSyn. The goal is to support
> spectral analysis, processing and synthesis for music applications.
>
> I would like to be able to measure the amplitude of various sinewave
> partials in the original signal. With my current scaling, if I do an FFT of
> a sine wave with amplitude 1.0 aligned with a bin then the magnitude comes
> out 1.0.
>
>     magnitude = sqrt(real*real + imag*imag);
>
> Also my FFT and IFFT are inverse functions:   x==IFFT(FFT(x))
>
> My current scale factors are 2.0/M for FFT and 0.5 for IFFT. I am happy with
> this. But I see many conflicting recommendations in the literature that
> suggest I am doing it wrong.

Hi Phil,

The correct scaling factor depends on what you want to do with it.

For example: convolution

Suppose my input is a vector with a simple unit impulse at the the first index.
Then, the convolution of this signal with itself is expected to be
itself.  The spectrum of this signal is 1, everywhere.

That's not what you'd get, if you used your scaling factor 2/M on the
DFT.  The correct scaling factor for this application is 1 on the DFT
and 1/M for the IDFT.  (Try it for yourself for the DFT, and use the
CFT to explain why more generally).

Next example:  isometric fourier transform

Suppose I have a signal and I want to know how the energy is
distributed with respect to frequency.  The isometric fourier
transform has scaling factor 1/sqrt(M) on each of the DFT and IDFT.
The sum of squares of my signal (the metric) and the sum of squares of
its spectrum are identical.

Your scaling factors are perfectly fine, if what you want to do is
read the amplitude of signal components in the spectrum :)

Chuck
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to