# IIR filter design in digital domain using Magnitude Squared

Does anyone have any good references for deriving parameters of an IIR Low pass/High Pass filter directly in the digital domain using the magnitude squared at the corner frequency?

I have been able to derive the parameters of a first order Low/High pass filter with 3 dB attenuation at the corner frequency i.e. calculating K and alpha in:-

````H(Z) = k(1+z^-1)/(1-alpha*z^-1)
````

My issue is that I distinctly remember deriving the parameters using a 6 dB attenuation at the corner frequency in a DSP course I have done previously but I have forgotten the trigonometric identiftes used to finish the derivation.

The general procedure is as follows:- 1) Let w = 0/pi to calculate the gain term k such that there is a 0dB gain at 0/pi 2) Calculate the magnitude squared at the corner frequency to obtain a value for alpha in terms of the corner frequency.

The problem may be that it should be a second order filter or I am recalling the method for a band pass/stop filter but I'm not sure and it appears this method is not used very often except in the case of band pass/stop filters for parametric EQ.

I hope the question is clear and I will try to improve the structure with the responses so it will be useful for others. Any help will be apreciated

-

– B Z Feb 27 at 16:01

## 1 Answer

To solve the case that you mentioned...

You have 2 variables to determine, so you need two relationships to resolve the two variables. I'm going to use $k$ and $a$ as the variables to make this easy to type up.

$H(z) = k\frac{1 + z^-1}{1-az^-1}$

Start by considering the passband gain. Use $f = 0$ for this. Assume you want unity gain at $f_0=0$.

Assume: $H(f_0) = 1, f_0 = 0$

Substitute $e^{i2\pi f/fs}$ for z, fs is your sampling rate, set $f = 0$ and solve for $k$ to satisfy $H(f_0) = 1$

From this you get $k = \frac{(1-a)}{2}$

Now work on the gain squared at your desired corner frequency ($f_c$) to determine $a$.

$H(f_c) = -3$dB (magnitude squared will be -6dB as you've stated)

We'll work with the magnitude squared at $f_c$ and set the gain to 1/2 (-6dB).

$|H(f_c)|^2 = \frac{1}{2}$

This time substitute $e^{i2\pi fc/fs}$ for z.

To simplify the arithmatic you can solve this equation:

$$\left(\frac{|H(f0)|}{|H(fc)|}\right)^2 = 2$$

This eliminates the factor $k$.

You will end up with a quadradic relationship in $a$. Solving for $a$ yields:

$a = \frac {1 - \sqrt{1-cos^2(2\pi\frac{f_c}{f_s})}} {cos(2\pi\frac{f_c}{f_s}) }$

Simplify this to:

$a = \frac {1 - sin(2\pi\frac{f_c}{f_s})} {cos(2\pi\frac{f_c}{f_s}) }$

-

1
@Peter k Thanks Peter! – B Z Feb 28 at 18:18
You're welcome! :-) I just have OCD when it comes to math formatting. :-) – Peter K.♦ Feb 28 at 19:11

2
I have to get my posts in quickly, so I don't always get things the way I want them. My wife was glaring at me last night when she noticed I was posting some geeky thing on the internet instead of watching "The Bachelor" with her. – B Z Feb 28 at 20:26
Thank you for the response and the detailed derivation. I had the same result for the 3dB case, however, when I mentioned the 6dB attenuation I was referring to the design specification such that magnitude squared will have 12 dB attenuation. It is more than likely the lecturer plotted the magnitude squared and this is where the confusion has set in. I'm happy enough that this is the case and will use a -3db corner frequency. Cheers – melinnde Feb 28 at 23:03
I see, I missed the original point. I would agree that the prof was probably using mag squared to simplify the math. 3dB is generally used because it is a corner frequency. 6dB is well into the filter transition region which is less well defigned. – B Z Mar 1 at 12:28
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 22, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9437698721885681, "perplexity_flag": "middle"}