Re: Drawing an EQ curve
Re: Drawing an EQ curve
- Subject: Re: Drawing an EQ curve
- From: Chandrasekhar Ramakrishnan <email@hidden>
- Date: Wed, 03 Sep 2003 20:13:30 -0700
>
On 9/3/03 11:33 AM, "Robert Grant" <email@hidden> wrote:
>
>
If I wanted to show a graphical representation of an EQ curve with
>
Freq, Gain and Q is there a cheap way to do it?
Off the top of my head...
Without knowing how the Apple parametric EQ AU computes its filter
coefficients, i'd just pick some arbitrary method for computing filter
coefficients, given a center freq, gain, and Q. E.g.,
http://www.mathworks.com/products/education/homework/signal/signal_problem1.shtml
http://ccrma-www.stanford.edu/~jos/filters/ (may have some too)
Once you have the filter coefficients, you can FFT to get the
frequency response.
In pseudo-code, using the method described on the mathworks site
above:
zeros = { Gain };
// center is normalized to 0->pi
poles = { 1, center/Q, pow(center, 2) };
paddedZeros = zeropad(zeros, fftLength);
paddedPoles = zeropad(poles, fftLength);
// division in next line is point wise division of
// complex numbers
freqResponse = fft(paddedZeros) / fft(paddedPoles);
freqResponse = 10 * log(freqResponse); // to get it in dB
Something like that...
James Chandler's method would produce more accurate results, but this
method may be cheaper.
- sekhar
--
C. Ramakrishnan email@hidden
_______________________________________________
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.