Why does Pre-warping work with a notch filter but not a low pass filter?

Hey guys a little bit of a continuation from a previous post I made here, I found the solution as why the pre-warping was not working at the time,

However I was just playing around and found out pre warpings were working with notch filters pretty good oppose to the low pass filters, now I am more then confused. I wonder if anyone can explain this to me?

Ill give two case sceneries where the Critical frequency is close to and not close to the Nyquist frequencies.

Diagrams

Test 1:

• Critical Frequency = 40kHz
• Sampling Frequency = 96kHz
• Ratio = 40kHz/48kHz = 83.33% pretty close.

Test 2:

• Critical Frequency = 20kHz
• Sampling Frequency = 96kHz
• Ratio = 20kHz/48kHz = 42% halfish close.

Test 3:

• Critical Frequency = 10kHz
• Sampling Frequency = 96kHz
• Ratio = 10kHz/48kHz = 21% closeish.

What the heck is going on, Why is it working for notch and not a low pass?!

The bilinear transform compresses the analog frequency in the s-domain associated with $$f=\infty$$ to the point $$z=-1$$ in the z-domain (which is where the frequency is $$f_s/2$$ where $$f_s$$ is the sampling rate. Consider what the magnitude of your notch filter is at $$f=\infty$$: It has no effect on the magnitude or phase of your signal; there is no filtering impact there whatsoever.

Compare in contrast to this your low pass filter (and how much of your "desired" shape is already beyond the Nyquist boundary which no pre-warping would be able to reconstruct). As you approach the Nyquist boundary the ability to compensate with pre-warping becomes increasingly difficult (you will see the same with the notch if it is brought close enough such that there is continued attenuation beyond the boundary).

The degree of this frequency warping and how it pronounced is depicted in the chart example that I pasted below (not the OP's sampling rates) which shows which frequency on the vertical axis for a given sampling rate of 20 rad/sec (125.6 Hz) would map to the digital frequency domain extending from $$\pi$$ to $$\pi$$ rad/sample.

With prewarping, especially at high frequencies, it is very difficult to match an analog shape over a wider frequency range given this mapping is according to the following transcendental equation (would require Taylor series expansion out to an increasingly higher order as we near the Nyquist boundary to match effectively, but is easily matched with the first or second terms only at the lower frequencies where the slope becomes approximately linear):

$$\omega_a = \frac{2}{T}tan(\omega_d T/2)$$

(as referenced here: https://en.wikipedia.org/wiki/Bilinear_transform)

But for a single point, or narrow range as typical for a notch filter, this repositioning of a single notch zero would be trivial to do and with high accuracy for the repositioned notch location (but distortion right at the Nyquist boundary if the target filter has residual insertion loss beyond Nyquist).

• Once again to the rescue, thought I was going crazy for a second. I can rest easy tonight. Off topic: By any chance is there any good literature to how to make a FIR filter? – Pllsz Sep 25 '20 at 3:26
• @Pllsz I can see where you were coming from on that. When you say "how to make", do you mean how to design, how to simulate or how to implement? – Dan Boschen Sep 25 '20 at 3:30
• Implement I got it, more so designing where to start and what not – Pllsz Sep 25 '20 at 3:34
• @Pllsz I teach what I think is a great course on that specifically which I highly recommend :) but next one won't be until next spring. – Dan Boschen Sep 25 '20 at 3:48
• @Pllsz We won't be able to carry on an extended chat here as it will flag to moderators and waste their time. The site wants to keep the comments specific to the Q&A and the Q's to be concise and easily answered (as opposed to a tutorial site). As you learn / research on your own you'll have such questions to post I am sure! It is fun stuff. – Dan Boschen Sep 25 '20 at 4:11