Jump to content

Second Order Filters

From PrattWiki

This page is currently a sandbox for things related to second-order filters.

General Form

For the cases below, we will be looking at specific examples of second-order filters, and in each case we will turn on specific components of a general second-order filter by setting $ K_H $, $ K_B $, and $ K_L $ to a non-zero value in:

$ \mathbb{H}(s)=\frac{K_H(s^2)+K_B(2\zeta \omega_ns)+K_L(\omega_n^2)}{s^2+2\zeta \omega_ns+\omega_n^2} $

or as a Fourier Transform,

$ \mathbb{H}(s)=\frac{K_H((j\omega)^2)+K_B(2\zeta \omega_n(j\omega))+K_L(\omega_n^2)}{(j\omega)^2+2\zeta \omega_n(j\omega)+\omega_n^2} $

Band-Pass

For the band-pass filter, with $ K_B $ set to some non-zero value and $ K_H $ and $ K_L $ both set to zero, the transfer function becomes:

$ \mathbb{H}_B(s)=\frac{K_B(2\zeta \omega_ns)}{s^2+2\zeta \omega_ns+\omega_n^2} $

or, as a Fourier transform,

$ \mathbb{H}_B(j\omega)=\frac{K_B(2\zeta \omega_n(j\omega))}{(j\omega)^2+2\zeta \omega_n(j\omega)+\omega_n^2} $

which is the form we will use here.

Alternate Representation

To analyze this transfer function more easily, we can divide through by the $ 2\zeta\omega_n(j \omega) $ term to get:

$ \begin{align*} \mbox{Divide by } 2\zeta\omega_n(j \omega)&~ & \mathbb{H}_B(j\omega)&=\frac{K_B}{\frac{j\omega}{2\zeta\omega_n}+1+\frac{\omega_n}{2\zeta j\omega}}\\ \mbox{Rearrange 1st and 2nd part of denominator} &~ & ~&=\frac{K_B}{1+\frac{j\omega}{2\zeta\omega_n}+\frac{\omega_n}{2\zeta j\omega}}\\ \mbox{Pull out }\frac{j}{2\zeta}\mbox{ from complex terms} &~ & ~&=\frac{K_B}{1+\frac{j}{2\zeta}\left(\frac{\omega}{\omega_n}-\frac{\omega_n}{\omega}\right)}\\ \end{align*} $

where the - sign in the last part comes from the fact that $ 1/j=-j $. At this point, we introduce a new quantity, the quality factor of the filter $ Q $, where $ Q=\frac{1}{2\zeta} $, such that:

$ \begin{align*} \mathbb{H}_B(j\omega)&=\frac{K_B}{1+jQ\left(\frac{\omega}{\omega_n}-\frac{\omega_n}{\omega}\right)}\\ \end{align*} $

Magnitude and Phase

This alternate arrangement makes it easier to determine how the magnitude and phase change as the frequency changes:

Magnitude

To find the magnitude of $ \mathbb{H}_B(j\omega) $, find the magnitude of the numerator and divide it by the magnitude of the denominator:

$ \begin{align*} |\mathbb{H}_B(j\omega)|&=\frac{|K_B|}{\sqrt{1^2+Q^2\left(\frac{\omega}{\omega_n}-\frac{\omega_n}{\omega} \right)^2}} \end{align*} $

From this, we can see that the numerator has a constant magnitude. Furthermore, the denominator has a constant real part. This means that the magnitude of the denominator is going to be at its smallest when $ \omega=\omega_n $; any deviation from this will create a non-zero imaginary part and thus increase the size of the denomintor. From this we can assert the following:

  • The largest magnitude of this band-pass filter is $ |K_B| $ and it occurs when $ \omega=\omega_n $.

Phase

To find the phase of $ \mathbb{H}_B(j\omega) $, find the phase of the numerator and subtract the phase of the denominator from it. For a complex number $ \mathbb{n}=n_r+jn_i $, the angle is given by $ \arctan(n_i/n_r) $; for the denominator of $ \mathbb{H}_B(j\omega) $, the real part is simply 1 so the angle of the denominator is the arctangent of the imaginary part. The angle of the numerator depends on the sign of $ K_B $:

$ \begin{align*} \angle \mathbb{H}_B(j\omega)&=\angle K_B - \arctan\left(Q\left(\frac{\omega}{\omega_n}-\frac{\omega_n}{\omega} \right) \right) \end{align*} $

Once again, $ \omega=\omega_n $ is an interesting point to consider - the denominator will contribute $ 0^o $ to the phase of the transfer function here. As $ \omega $ gets larger, the phase angle of the transfer function will shift by $ -90^o $ degrees while smaller values of $ \omega $ will shift the transfer function by up to $ +90^o $. There is therefore a total $ 180^o $ phase shift from the smallest frequencies to the highest frequencies - this is to be expected from a transfer function with two corners in the denominator. From this we can assert the following:

  • The phase of this band-pass filter when $ \omega=\omega_n $ is $ 0^o $ if $ K_B $ is positive and $ 180^o $ if $ K_B $ is negative.

Half-Power Frequencies

Next we will look at the cutoff, or half-power, frequencies for this filter. Recall that the half-power frequencies $ \omega_{hp} $ are defined as the frequencies where:

$ \begin{align*} \left|\mathbb{H}\left(j\omega_{hp}\right)\right|&=\frac{1}{\sqrt{2}}\left|\mathbb{H}(j\omega)\right|_{\mathrm max} \end{align*} $

or, since it will be much easier to calculate without the square roots involved in finding magnitudes,

$ \begin{align*} \left|\mathbb{H}\left(j\omega_{hp}\right)\right|^2&=\frac{1}{2}\left|\mathbb{H}(j\omega)\right|_{\mathrm max}^2 \end{align*} $

Since we know the formula for the magnitude as well as the maximum magnitude, we can substitute that formula and that constant in for this band-pass filter to get:

$ \begin{align*} \frac{K_B^2}{1+Q^2\left(\frac{\omega_{hp}}{\omega_n}-\frac{\omega_n}{\omega_{hp}}\right)^2}&=\frac{1}{2}K_B^2 \end{align*} $

Since the numerators are the same, the denominators need to be the same, which gives:

$ \begin{align*} Q^2\left(\frac{\omega_{hp}}{\omega_n}-\frac{\omega_n}{\omega_{hp}}\right)^2&=1 \end{align*} $

To solve for $ \omega_{hp} $ requires...some...algebra:

$ \begin{align*} \mbox{Original}&~ & Q^2\left(\frac{\omega_{hp}}{\omega_n}-\frac{\omega_n}{\omega_{hp}}\right)^2&=1\\ \mbox{Common denominator}&~ & Q^2\left(\frac{\omega_{hp}^2-\omega_n^2}{\omega_{hp}\omega_n}\right)^2&=1\\ \mbox{Take square root}&~ & Q\left(\frac{\omega_{hp}^2-\omega_n^2}{\omega_{hp}\omega_n}\right)&=\pm 1\\ \mbox{Cross-multiply}&~ & Q\omega_{hp}^2-Q\omega_n^2&=\pm\omega_{hp}\omega_n\\ \mbox{Move everything left}&~ & Q\omega_{hp}^2\mp\omega_{hp}\omega_n-Q\omega_n^2&=0 \end{align*} $

Now we can solve the quadratic equation for $ \omega_{hp} $:

$ \begin{align*} \omega_{hp}&=\frac{\pm\omega_n\pm\sqrt{\omega_n^2+4Q^2\omega_n^2}}{2Q}\\ \omega_{hp}&=\frac{\pm\omega_n\pm\omega_n\sqrt{1+4Q^2}}{2Q} \end{align*} $

This would seem to indicate that there are four half-power frequencies. There are two negative and two positive values, so we will only consider the positive ones. Which ones are those? We know that $ \omega_n\sqrt{1+4Q^2}\geq\omega_n $ for real values of $ Q $ so to get the positive $ \omega_{hp} $, we will center the solutions on $ \omega_n\sqrt{1+4Q^2} $:

$ \begin{align*} \omega_{hp}&=\frac{\omega_n\sqrt{1+4Q^2}}{2Q}\pm\frac{\omega_n}{2Q} \end{align*} $

which can be re-arranged and presented in the following two ways:

$ \begin{align*} \omega_{hp}&=\omega_n\sqrt{1+\frac{1}{4Q^2}}\pm\frac{\omega_n}{2Q}\\ \omega_{hp}&=\omega_n\sqrt{1+\zeta^2}\pm\zeta\omega_n \end{align*} $

From this, you can see that there are two positive half-power frequencies centered on $ \omega_n\sqrt{1+\zeta^2} $ with a total distance of $ \omega_n/Q $ or $ 2\zeta\omega_n $ between them. That gives rise to the following definitions:

  • The linear center (algebraic average) frequency is the average of the cutoff frequencies:
    $ \begin{align*} \omega_{cen, lin}&=\frac{\omega_{hp,low}+\omega_{hp,high}}{2}\\ ~&=\frac{\omega_n\sqrt{1+\zeta^2}-\zeta\omega_n+\omega_n\sqrt{1+\zeta^2}+\zeta\omega_n}{2}\\ ~&=\omega_n\sqrt{1+\zeta^2}~\mbox{ or }~\omega_n\sqrt{1+\frac{1}{4Q^2}} \end{align*} $
  • The bandwidth is the difference between the cutoff frequencies:
    $ \begin{align*} BW&=\omega_{hp,high}-\omega_{hp,low}\\ ~&=\omega_n\sqrt{1+\zeta^2}+\zeta\omega_n-\omega_n\sqrt{1+\zeta^2}+\zeta\omega_n\\ ~&=2\zeta\omega_n~\mbox{ or }~\frac{\omega_n}{Q} \end{align*} $

We can also look at the product of the high and low half-power frequencies (recall that $ (a-b)(a+b)=a^2-b^2 $):

$ \begin{align*} \omega_{hp,low}\omega_{hp,high}&=\left(\omega_n\sqrt{1+\zeta^2}-\zeta\omega_n\right) \left(\omega_n\sqrt{1+\zeta^2}+\zeta\omega_n\right)\\ ~&=\omega_n^2(1+\zeta^2)-\zeta^2\omega_n^2=\omega_n^2 \end{align*} $

This means we can make the following assertion:

  • The logarithmic center (geometric average) frequency is the square root of the product of the low and high half-power frequencies and is equal to the natural frequency: $ \omega_{cen, log}=\omega_n=\sqrt{\omega_{hp,low}\omega_{hp,high}} $

Band-pass Summary

Given a second-order band-pass filter with a transfer function that can be written as:

$ \mathbb{H}_B(j\omega)=\frac{K_B(2\zeta \omega_n(j\omega))}{(j\omega)^2+2\zeta \omega_n(j\omega)+\omega_n^2} $

or

$ \begin{align*} \mathbb{H}_B(j\omega)&=\frac{K_B}{1+jQ\left(\frac{\omega}{\omega_n}-\frac{\omega_n}{\omega}\right)}\\ \end{align*} $
  • Maximum gain: $ |K_B| $
  • Natural frequency: $ \omega_n $
  • Damping ratio: $ \zeta=\frac{1}{2Q} $
  • Quality factor: $ Q=\frac{1}{2\zeta} $
  • Cutoff frequencies: $ \omega_n\sqrt{1+\frac{1}{4Q^2}}\pm\frac{\omega_n}{2Q} $ or $ \omega_n\sqrt{1+\zeta^2}\pm\zeta\omega_n $
  • Bandwidth: $ 2\zeta\omega_n $ or $ \frac{\omega_n}{Q} $
  • Logarithmic center frequency: $ \omega_n $
  • Linear center frequency: $ \omega_n\sqrt{1+\zeta^2} $ or $ \omega_n\sqrt{1+\frac{1}{4Q^2}} $