[PD] plotting freq response of [cpole~] (or "vcf")

Alexandre Torres Porres porres at gmail.com
Wed Aug 13 02:34:40 CEST 2014


> Frequency response is normally computed in terms of

> magnitude and phase--because the result of applying

> a filter is to multiply the magnitudes and shift (add) the

> phases.

 That seems clear for me. I know how to get both mag/phase but my patch is
simplified to get the magnitude only. I also know how to get mag & phase
with real/Imaginary parts too. Where I get stuck is the z transform deal.
More precisely, adapting the patch to a complex version.

For instance, it works on plotting the freq response of a real pole with an
input of the filter coefficient. But I’d like to plot the freq response of
complex pole, from the real and imaginary part of the coefficient.



> To put it in terms of 'f' in Hz relative to the sampling frequency, use
> w=(2*pi/Fs) * f,  with Fs=sampling frequency in Hz



Yeah, the patch already calculates frequency in rad/sample. More over, it
uses complex frequencies, which are the cosine and sine of the freq in
rad/sample.



Now, as I said before, I know the transfer function of [cpole~] is is H(Z)
= 1/(1 - aZ^-1) – just like the [rpole~] by the way – but that is not clear
on how to deal with a complex coefficient.


> The next problem: you get a complex number in the denominator.



I guess you mean what I just said :)


> Multiply numerator and denominator by the conjugate and split into

> real and imaginary parts before applying the magnitude and phase

> calculations to get your spectrum.  Your coefficient 'a'  is a complex

> number, so work carefully with the conjugate math to separate the

> real and imaginary parts.

well, if this is the solution to my problem, I don’t think I could follow
what you meant.



Anyway, I’m attaching a much more objective and simpler version of the
patch I’ve sent before. It also has a descriptive text that explains the
patch and the issue. I think I’m really close to nailing this. I just need
a tiny hand with the math.



Thanks

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140812/536cd08c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freq-resp-pole.pd
Type: application/octet-stream
Size: 15309 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140812/536cd08c/attachment-0001.obj>


More information about the Pd-list mailing list