Signals and Systems with MATLAB Applications, Second Edition

We will use MATLAB for all computations.
<span class="serif">% PART I - Find Resistor values for second order Butterworth filter, a=sqrt(2), b = 1a=sqrt(2); b =1; C1=10^(-8); C2=C1; fc=1000; wc=2*pi*fc; K=2;R2=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*wc);R1=b/(C1^2*R2*wc^2); R3=(K*R2)/(K-1); R4=K*R2; fprintf(' \n');...fprintf('R1 = %5.0f Ohms \t',R1); fprintf('R2 = %5.0f Ohms \t',R2);...fprintf('R3 = %5.0f Ohms \t',R3); fprintf('R4 = %5.0f Ohms \t',R4)</span>R1=12582 Ohms R2=20132 Ohms R3=40263 Ohms R4=40263 OhmsWe choose standard resistors as close as possible to those found above. These are shown in the MATLAB code below. Part II of the code is as follows:
<span class="serif">f=10:10:20000; w=2*pi*f; R1=12700; R2=20000; R3=40200; R4=R3; K=1+R4/R3;...wc=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*R2); s=w*j; Gw=(K.*s.^2)./(s.^2+a.*wc.*s./b+wc.^2./b); semilogx(f,abs(Gw)); grid; hold on;...xlabel('Frequency, Hz'), ylabel('Vout/Vin');...title('2nd Order Butterworth High-Pass Filter Response')</span><a name="1524"></a><a name="IDX-11-80"></a>
We will use MATLAB for all computations.
<span class="serif">% PART I - Find Resistor values for second order band-pass filter f0 = 1 KHzQ=10; K=10; C1=10^(-7); C2=C1; f0=1000; w0=2*pi*f0; R1=(2*Q)/(C1*w0*K);...R2=(2*Q)/(C1*w0*(-1+sqrt((K-1)^2+8*Q^2))); R3=(1/(C1^2*w0^2))*(1/R1+1/R2);R4=2*R3;...R5=R4; fprintf(' \n'); fprintf('R1 = %5.0f Ohms \t',R1); fprintf('R2 = %5.0f Ohms \t',R2);...fprintf('R3 = %5.0f Ohms \t',R3); fprintf('R4 = %5.0f Ohms \t',R4);...fprintf('R5 = %5.0f Ohms \t',R5)</span>R1=3183 Ohms R2=1110 Ohms R3=3078 Ohms R4=6156 Ohms R5=6156 OhmsWe choose standard resistors as close as possible to those found above. These are shown in the MATLAB code below. Part II of the code is as follows:
<span class="serif">K=10; Q=10; f=10:10:10000; w=2*pi*f; R1=3160; R2=1100; R3=3090; R4=6190;R5=R4;...w0=(2*Q)/(C1*R1*K); B=w0/Q; s=w*j; Gw=(K.*B.*s)./(s.^2+B.*s+w0.^2);...semilogx(f,abs(Gw)); axis([500 2000 0 10]); grid; hold on; xlabel('Frequency, Hz'),...ylabel('Vout/Vin'); title('2nd Order Butterworth Band-Pass Filter Response')</span><a name="1525"></a><a name="IDX-11-81"></a>
We will use MATLAB...