Re: CoreAudio and equalization
Re: CoreAudio and equalization
- Subject: Re: CoreAudio and equalization
- From: Steve Bird <email@hidden>
- Date: Wed, 26 Jun 2002 20:44:57 -0400
On Wednesday, June 26, 2002, at 07:44 PM, john wrote:
Hello,
I'm not sure if this is appropriate for the typical type of question on
this list, so forgive if it is not.
I'm trying to alter the audio data given in the recordIOProc in the
frequency domain. The code does an FFT transform (using Don Cross's
source), then uses this:
// in a loop the size of the buffer using i
z = realBuffer[i];
v = imagBuffer[i];
// calculate decAdjustment here
intensity = sqrt(z * z + v * v);
thetaValue = (z == 0.0) ? 0.0 : atan2(z, v);
intensity *= decAdjustment;
z = intensity * cos(thetaValue);
v = intensity * sin(thetaValue);
realBuffer[i] = z;
imagBuffer[i] = v;
Now doing this causes there to be static/fuzz in the audio. Looking
around on the web I see that a windowing function may be needed to
"smooth the edges" between alterations to the data in the frequency
domain.
However, using the hamming window (or hanning or blackman) even without
the EQ modifications causes the audio to sound weird!
--- The purpose of windows is to correct the measurement of spectra for
the head-tail mismatch I mentioned earlier. A hamming window reduces the
amplitude of the time wave to zero at the head and tail, thus there is no
mismatch, so the high-freq artifacts are not there. Each type of window
has a specific correction factor you should apply to the FFT output to
obtain an accurate reading of the amplitude Y at frequency X. But the
windowing process is a distortion of the time wave, and non reversible.
You don't need to do it if you just diddle the spectrum and inverse FFT it
again.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.