I must disagree.  The cleanest way to compute the transfer function
<https://en.wikipedia.org/wiki/Digital_filter#Characterization>, is to *compute
the transfer function*, directly — you'll get an exact answer, with minimal
computational expense.

If I have a filter defined as:

y[t] = b0*x[t]
  + b1*x[t-1] + b2*x[t-2]
  - a1*y[t-1] - a2*y[t-2];

This corresponds to a transfer function:

H(z) = (b0 + b1*z^-1 + b2*z^-2) / (1 + a1*z^-1 + a2*z^-2)

(Note that "a" coefficients become negative.)

If I want to find the response of that filter to a frequency of 1000 hz,
where the sample-rate is 10000 hz, I compute this Z-function for the
corresponding complex frequency:

z = e^(i*2pi*f/S)
... = e^(i*2pi*1000/10000)
... = cos(2pi*.1) + i*sin(2pi*.1)

Pass that number through the transfer function H(z) above, and you'll get
an exact answer for whatever frequency you like.


There's a lot of misinformation floating around about this topic, and I
imagine it's because people are put off by complex numbers and Z-domain
math.  It isn't as spooky as it looks!

– Evan Balster
creator of imitone <http://imitone.com>

On Tue, Jan 17, 2017 at 10:35 AM, Richard Dobson <[email protected]>
wrote:

> The cleanest way is to feed a single "unit impulse" through the filter and
> store the output, which is by definition the impulse response (assuming
> this is a standard LTI filter). Then take the FFT of the impulse response
> to get the transfer function, which is the response curve you are looking
> for. The unit impulse is exactly what the name says - a single sample of
> full amplitude followed by silence.
>
> Richard Dobson
>
>
> On 16/01/2017 20:20, Waverly Edwards wrote:
>
>> May I ask what ways are there to get the response curve of a filter?  My
>> current method is to pass a white noise source through the filter and
>> write the output to disk, then read the disk output into Audacity and
>> plot the output.
>>
>> This is the only way that I’ve come up which makes sense as I believe
>> Audacity is using some form of Fourier Transform on the data.  I’ve been
>> looking at the vDSP functions for FFT.  This is the direction that I am
>> headed, using FFT but even though I don’t know any other way, I feel
>> this must be using a sledgehammer to kill a mosquito.
>>
>>
>>
>> Any thoughts on this?
>>
>>
>>
>> Thank you,
>>
>>
>>
>>
>>
>> W.
>>
>>
>>
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/coreaudio-api/richar
>> d%40rwdobson.com
>>
>> This email sent to [email protected]
>>
>>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/coreaudio-api/evan%40imitone.com
>
> This email sent to [email protected]
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to