DSPRelated.com
Forums

FFT magnitude for frequency analyzer

Started by jungledmnc August 4, 2008
Hi there,
I'm trying to implement frequency analyzer for audio signal using DFT.
Nothing extraordinary, just take e.g. 4096 source samples, apply windowing,
pass through DFT and get magnitude of particular frequency bin via 

msqrt(msqr(Re) + msqr(Im))
, then maybe some overlapping or whatsoever.

Let's say, that source samples are in -1..1. The problem is, even if the
source signal is for example a sine wave at 400Hz, magnitude of several
bins highly exceeds 1, which I think is pretty weird. 

I have read a few topics about this and there were some things about
calibration. But I really don't understand this, since if I imagine a sine
wave in range -1..1 at frequency at exactly one frequency bin, then this
bin should contain combination of one sine and cosine with the same
magnitude, shouldn't it?

dmnc
Here's a reference on the calibration factors involved.
Steve

http://www.dspguide.com/ch8/5.htm
On Aug 5, 7:21 am, "jungledmnc" <jungled...@gmail.com> wrote:
> Hi there, > I'm trying to implement frequency analyzer for audio signal using DFT. > Nothing extraordinary, just take e.g. 4096 source samples, apply windowing, > pass through DFT and get magnitude of particular frequency bin via > > msqrt(msqr(Re) + msqr(Im)) > , then maybe some overlapping or whatsoever. > > Let's say, that source samples are in -1..1. The problem is, even if the > source signal is for example a sine wave at 400Hz, magnitude of several > bins highly exceeds 1, which I think is pretty weird. > > I have read a few topics about this and there were some things about > calibration. But I really don't understand this, since if I imagine a sine > wave in range -1..1 at frequency at exactly one frequency bin, then this > bin should contain combination of one sine and cosine with the same > magnitude, shouldn't it? > > dmnc
You would be better plotting the periodogram (power spectrum). Magnitude squared/N. Then take 10Log10 to convert to dB. K.
Yeah, got it, thanks a lot guys!

Dmnc
If you see the window effect (leakage) and want to remove it, here is
a good article:

Dynamic Signal Analysis Basics.PDF

http://www.go-ci.com/products.asp

James