2
\$\begingroup\$

Just playing around with the 'c2d' command from matlab and trying to convert a continuous 2nd - order lowpass Butterworth function to a digital one which has the specs of Fc = 20e3Hz and Fs = 44.410e3Hz.

When I apply the pre-warping frequency parameter of 20e3Hz, it doesn't close to mimicking the continuous function.

Is there a reason why this is occurring? Does the prewarping have a limitation of how much it can "pre-warp" or am I doing something wrong? Maybe that's the intended output?

Legends:

  • LP = Continuous TF
  • LP_D = Discrete TF

enter image description here

Code:

s = tf('s');

LP = 15587249629.803/(s^2+176556.77655678*s+15587249629.803);
LP_D = c2d(LP,1/44.410e3,['Method','tustin','prewarpFrequency',125663.706]);

UPDATE: With a higher FS = 96e3Hz from 44.410e3Hz with no pre warping:

enter image description here

UPDATE2: Comparing with and without prewarping on two different Fs (44.410kHz and 96kHz) using a 3rd order Butterworth filter lowpass

Cutoff frequencies:

  • LP = 1.25e5 rad/s
  • LP_D_44kHz = 6.70e4 rad/s
  • LP_D_96kHz = 1.10e5 rad/s

With pre-warping:

enter image description here

Cutoff frequencies:

  • LP = 1.25e5 rad/s
  • LP_D_44kHz = 8.59e4 rad/s
  • LP_D_96kHz = 1.13e5 rad/s

Without pre-warping: enter image description here

UPDATE 3: Doing some research I might have an idea. Just a gut feeling.

I found 2 resources that converted an analog Butterworth into a discrete one using the Tustin method with prewarping and it worked for them.

I noticed they created the Butterworth filter completely different from the way I did it. I made mine based on the Sallen-Key configuration and just found the transfer function, could that be it? For some reason the Sallen-Key way doesn,'t like the prewarping?

Resources HERE and HERE

I also noticed when using a notch filter with the same sampling frequency (44.410kHz) and prewarping it works perfectly. Why when doing low pass filters it doesn't like it that much?

UPDATE 4: Could be the warping is just to nonlinear for it?

\$\endgroup\$
10
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – Voltage Spike
    Sep 23, 2020 at 21:40
  • \$\begingroup\$ Update main post. Found new findings \$\endgroup\$
    – Leoc
    Sep 23, 2020 at 22:36
  • 1
    \$\begingroup\$ @Leoc If you read through the comments, you'd have seen that I said your corner frequency is too close to Nyquist. Same thing here. The prewarping implies a tan(), and that's the effect you're seeing here. Also, when replying to someone, use @<tab> to select the name, otherwise the other person might not get noticed. \$\endgroup\$ Sep 24, 2020 at 10:29
  • 1
    \$\begingroup\$ "I am aware of the tagging" -- it never hurts to be cautious. And, yes, that's why it all happens. If you want a nice, clean waveform at the end, you need some 10x f0 compared to the highest fp. Same with frequency-domain. Never forget that bilinear transform implies a mapping of a linear domain, s, to a strongly nonlinear domain, z. \$\endgroup\$ Sep 24, 2020 at 19:23
  • 1
    \$\begingroup\$ @Leoc I meant fp = passband (corner) frequency and f0 = sampling frequency. \$\endgroup\$ Sep 24, 2020 at 19:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.