Question 6.8: Computer-Generated Bode Plot The circuit of Figure 6.41 is a...

Computer-Generated Bode Plot
The circuit of Figure 6.41 is a notch filter. Use MATLAB to generate a magnitude Bode plot of the transfer function H(f ) = Vout/Vin with frequency ranging from 10Hz to 100 kHz. Then, analyze the circuit manually at very high and very low frequencies to provide checks on the plot. Use the plot to determine the frequency of maximum attenuation and the value of the transfer function at that frequency.

6.41
The 'Blue Check Mark' means that either the MATLAB code/script/answer provided in the answer section has been tested by our team of experts; or the answer in general has be fact checked.

Learn more on how do we answer questions.

Using the voltage-divider principle, we can write the transfer function for the filter as

H(f)=\frac{\mathrm{V_{out}}}{\mathrm{V_{in}}}=\frac{R_3}{R_1+R_3+1/[j\omega C+1/(R_2+j\omega L)]}

A MATLAB m- file that produces the Bode plot is:

clear
% Enter the component values:
R1 = 90; R2 = 10; R3 = 100;
L = 0.1; C = 1e-7;
% The following command generates 1000 frequency values
% per decade, evenly spaced from 10^1 to 10^5 Hz
% on a logarithmic scale:
f = logspace(1,5,4000);
w = 2*pi*f;
% Evaluate the transfer function for each frequency.
% As usual, we are using i in place of j:
H = R3./(R1+R3+1./(i*w*C + 1./(R2 + i*w*L)));
% Convert the magnitude values to decibels and plot:
semilogx(f,20*log10(abs(H)))

The resulting plot is shown in Figure 6.42. This circuit is called a notch filter because it strongly rejects components in the vicinity of 1591 Hz while passing higher and lower frequencies. The maximum attenuation is 60 dB.
The m- file is named Example_6_8 and appears in the MATLAB folder, and if you have access to MATLAB, you can run it to see the result. (See Appendix F for information on how to access the MATAB folder.) Then, you can use the toolbar on the figure screen to magnify a portion of the plot and obtain the notch frequency and maximum attenuation with excellent accuracy.
The command

f = logspace(1,5,4000)

generates an array of 4000 frequency values, starting at 101 Hz and ending at 105 Hz, evenly spaced on a logarithmic scale with 1000 points per decade. (Typically, we might start with 100 points per decade, but this transfer function changes very rapidly in the vicinity of 1590Hz, so we increased the number of points to more accurately determine the location and depth of the notch.)
As a partial check on our analysis and program, we analyze the circuit at f = 0 (dc) to determine the transfer function at very low frequencies. To do so, we replace the inductance by a short and the capacitance by an open circuit. Then, the circuit becomes a simple resistive voltage divider consisting of R1, R2, and R3. Therefore, we have

H(0)=\frac{\mathrm{V_{out}}}{\mathrm{V_{in}}}=\frac{R_3}{R_1+R_2+R_3}=0.5

In decibels, this becomes

H_{\mathrm{dB}}(0)=20\log{(0.5)}=-6\mathrm{~dB}

which agrees very well with the plotted value at 10Hz.
For a second check, we replace the capacitance by a short circuit and the inductance by an open circuit to determine the value of the transfer function at very high frequencies. Then, the circuit again becomes a simple resistive voltage divider consisting of R1 and R3. Thus, we have

H(\infty)=\frac{R_3}{R_1+R_3}=0.5263

In decibels, this becomes

H_{\mathrm{dB}}(\infty)=20\log {(0.5263)}=-5.575\mathrm{~dB}

which agrees very closely with the value plotted at 100 kHz.

6.42

Related Answered Questions