Help with THD+N calculations



Hi All,

My DSP knowledge is far too rusty and I've been hitting my head against
the wall for a little while now. Archives of the group have got
tantalisingly close but I'm still confused. The fun situation is
calculating THD+N of an audio signal.

What I'm doing:
a. 1KHz sine wave is my fundamental.
b. Notch Filter to remove the 1KHz
c. FFT (8Kpoint)
d. Get magnitudes (mag[] = sqrt(re[]^2 + im[]^2))
e. Calculate the total energy over the range 20Hz to 20KHz
Ex = sum(sqr(mag[k])) with k in 3-3143 (the FFT bins i'm
interested in)
f. thdn = sqrt(Ex) / (3143-3+1)

Now I need to compare that with the amplitude of the fundamental to get
my %age... whats an easy way to do that? Have I messed up anything so
far (i'm thinking i should be removing DC...)?

Thanks in advance,

Robert

.



Relevant Pages

  • Re: (OT) Lawyers
    ... To show how dumb I can be what does J.D. stand for? ... hitting my head against a wall trying to remember. ...
    (sci.space.history)
  • Re: (OT) Lawyers
    ... To show how dumb I can be what does J.D. stand for? ... hitting my head against a wall trying to remember. ...
    (sci.space.policy)
  • Re: Volumne control in MM2 ??
    ... Hello- With your information on volume control, I can stop hitting my head ... against the wall. ...
    (microsoft.public.windowsxp.moviemaker)
  • Re: Self defence
    ... >clearly not sexual assault or mugging, he'd been shouting insults ... raising it above his head ready to smash it against me. ... >at my friend because he'd supposedly heard him make a derogatory ... then a nearby brick wall can be a good weapon. ...
    (uk.legal)
  • Re: My wife nurses our 21month old son (overnight) - he has cavities (link ?)
    ... > place head against wall ... > move head back by flexing neck ... >>> are conducive to decay. ...
    (sci.med.dentistry)