Butterworth Filter

Calculus Level 5

The following difference equation describes a discrete second-order Butterworth low-pass filter.

The quantity x x is the input signal (which in this case consists of sine wave samples). The quantity y y is the filter output, which is a filtered version of the input signal. The filter processes at a rate of 1 0 5 10^5 samples per second ( 100 kHz ) (100 \, \text{kHz}) .

y k = b 1 x k + b 2 x k 1 + b 3 x k 2 a 2 y k 1 a 3 y k 2 a 1 b 1 = 0.0026 b 2 = 0.0053 b 3 = 0.0026 a 1 = 1 a 2 = 1.8492 a 3 = 0.8598 y_k = \frac{b_1 \, x_k + b_2 \, x_{k-1} + b_3 \, x_{k-2} - a_2 \, y_{k-1} - a_3 \, y_{k-2} }{a_1} \\ b_1 = 0.0026 \\ b_2 = 0.0053 \\ b_3 = 0.0026 \\ a_1 = 1 \\ a_2 = -1.8492 \\ a_3 = 0.8598

The k k subscript denotes the present processing interval, the k 1 k-1 subscript denotes the previous processing interval, and the k 2 k-2 subscript denotes two processing intervals ago.

At what input signal frequency (in Hz \text{Hz} ) is the gain of the filter 1 2 \frac{1}{\sqrt{2}} ? In other words, at what input frequency does the output have a magnitude approximately 0.707 0.707 times that of the input? This is known as the filter cutoff frequency.

Hints:
1) The answer is an integer multiple of 100 Hz 100 \, \text{Hz}
2) If all else fails, just build the filter and try different input frequencies
3) When observing the gain, we are looking for the peak value of the output sinusoid, in relation to the peak value of the input sinusoid


The answer is 1700.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Karan Chatrath
May 3, 2019

Another good problem on frequency domain analysis..

Let us consider the given difference equation:

y ( k ) = b 1 x ( k ) + b 2 x ( k 1 ) + b 3 x ( k 2 ) a 2 y ( k 1 ) a 3 y ( k 2 ) a 1 y(k) = \frac{b_1x(k) + b_2x(k-1) + b_3x(k-2) - a_2y(k-1) - a_3y(k-2)}{a_1}

By Rearranging:

a 1 y ( k ) + a 2 y ( k 1 ) + a 3 y ( k 2 ) = b 1 x ( k ) + b 2 x ( k 1 ) + b 3 x ( k 2 ) a_1y(k) + a_2y(k-1) + a_3y(k-2) = b_1x(k) + b_2x(k-1) + b_3x(k-2)

Now, from here, we establish a relation between input and output by deriving the transfer function. We do so by taking the Z-transform on both sides assuming no initial conditions. Doing so, and simplifying, we get:

G ( z ) = Y ( z ) X ( z ) = b 1 z 2 + b 2 z + b 3 a 1 z 2 + a 2 z + a 3 G(z) = \frac{Y(z)}{X(z)} = \frac{b_1 z^2 + b_2 z +b_3}{a_1 z^2 + a_2 z +a_3}

Here, Y ( z ) Y(z) and X ( z ) X(z) are the z-transforms of the signals y ( k ) y(k) and x ( k ) x(k) respectively. I have applied the rules of Z transform to compute the same for the time-delayed terms according to the this link: https://en.wikipedia.org/wiki/Z-transform

Having obtained the transfer function, I will highlight a bit of theory. For a linear difference or differential equation establishing some kind of input-output relation, a sinusoidal input of a known frequency gives a sinusoidal output of the same frequency but of a different amplitude and phase.

The ratio of the amplitudes of the output and input is given by the modulus of the following complex number:

M = G ( z ) M = \mid G(z)\mid

Where: z = e 2 π f T j z = e^{2\pi f T j} , j = 1 j = \sqrt{-1} , T is the sampling time; T = 1 0 5 s T = 10^{-5} s (Recall that 100,000 samples are taken per second), and f f is the frequency in Hz.

The goal of the question is to compute the frequency at which the magnitude ratio (M) is 0.707. To accomplish this, I have chosen to use a computer program here. By using a simple loop, the magnitude ratios can be computed for a large range of frequencies. A plot of the magnitude ratio vs. frequency can be seen as follows:

By inspecting the frequency and magnitude ratio arrays, it was found that for a frequency of 1684 Hz, the magnitude ratio is 0.7071. I entered the answer as 1700 Hz (approximating based on the hint), and it turned out to be correct. If the answer was supposed to be exactly 1700 Hz, I would want to know my mistake.

Very nice solution, thanks. I am also getting 1684 as the actual number, with the given coefficients. I think this is because I didn't give the coefficients with enough decimal places. But I designed the filter for 1700 Hz.

Steven Chase - 2 years, 1 month ago

Thanks for the problem and for the clarification

Karan Chatrath - 2 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...