HW03 Solutions boser

download HW03 Solutions boser

of 20

Transcript of HW03 Solutions boser

  • 7/22/2019 HW03 Solutions boser

    1/20

    EE247

    B. E. Boser Page 1 of 20

    Last modified 9/14/2011 4:08:00PM

    HOMEWORK #3

    1. 2ndorder band-pass filter.a) Find the sensitivity of the to (i.e. find ).

    ( )Substituting the expression for :

    This architecture has a sensitivity that is independent of the !Notice also that:

    b) Size the components for . How large is the component spread of the resistors?

    Solving the equation for for in terms of :

    Choosing and substituting :

    Notice that for a given , the component spread of the resistors is fixed to , which is 400 inthis problem! Even a moderate can result in unmanageable resistor component spreads.2. Design a 4thorder Butterworth low-pass filter.

    a) Synthesize the filter in MATLAB and determine the nominal component values (resistorsand capacitors) that meet the desired specifications.

    The transfer function for our filter is this:

    ( )( )

    This requires two Sallen-Key stages. Using the equations from chapter 2, slide 25 and

    setting G = 1,

    We can solve for C1and C2using these equations:

  • 7/22/2019 HW03 Solutions boser

    2/20

    EE247

    B. E. Boser Page 2 of 20

    Last modified 9/14/2011 4:08:00PM

    By inspection, for a fixed p and Qp, increasing R1 or R2will decrease both C1 and C2.

    Therefore, we set both resistors to their maximum values.

    For the first stage, For the second stage,

    The MATLAB code to determine the transfer function, plot the function, and then solve for

    the values is included below.

    clear all; close all;w_edge=2*pi*2e6;ripple=3;N=4;

    % Synthesize the filter[z,p,k]=butter(N,wp,'s');sys=zpk(z,p,k);set(sys, 'DisplayFormat', 'frequency');sys

  • 7/22/2019 HW03 Solutions boser

    3/20

    EE247

    B. E. Boser Page 3 of 20

    Last modified 9/14/2011 4:08:00PM

    %% Generate the magnitude and phase plot with annotationf=logspace(5,7,2000);[mag,phase]=bode(sys,2*pi*f);db = 20*log10(squeeze(mag));angle = squeeze(phase);mindB = -80; maxdB = 5; % Set vertical range of plot

    figure(1)subplot(2,1,1),set(gca, 'fontsize', 14);semilogx(f, db, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]')axis([min(f) max(f) mindB maxdB]),grid;ind = find (db > -ripple, 1, 'last');H = line( [min(f) f(ind)], [-ripple -ripple], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [f(ind) f(ind)], [-ripple mindB], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [min(f) max(f)], [0 0], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');

    subplot(2,1,2),set(gca, 'fontsize', 14);semilogx(f, angle, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Phase [degrees]')axis([min(f) max(f) -400 100]),grid;

    %% Calculate element values for the Sallen-Key Bi-quads%First Stagewp1 = sqrt(p(1)*p(2));Qp1 = wp1/(-2*real(p(1)));s1r1 = 100e3;s1r2 = 100e3;s1c1 = Qp1/wp1*(s1r1+s1r2)/s1r1/s1r2s1c2 = 1/Qp1/wp1/(s1r1+s1r2)

    %Second Stagewp2 = sqrt(p(3)*p(4));Qp2 = wp2/(-2*real(p(3)));s2r1 = 100e3;s2r2 = 100e3;s2c1 = Qp2/wp2*(s2r1+s2r2)/s2r1/s2r2s2c2 = 1/Qp2/wp2/(s2r1+s2r2)

    b)Re-scale the components such that under worst case conditions, the filter still meets thepassband specification under the worst case variations in the resistors and capacitors. What

    is the minimum frequency (fsmin) at which the filter has a guaranteed stopband attenuation

    of 45 dB?Recall from slide 25, with G=1:

    Because there is variation in the resistors and capacitors, we subsitute:

  • 7/22/2019 HW03 Solutions boser

    4/20

    EE247

    B. E. Boser Page 4 of 20

    Last modified 9/14/2011 4:08:00PM

    Note that the Q of the filter is unaffected. Therefore, the passband frequency will decreasethe most when both R and C increase, which is our worst-case variation. So we can pre-

    scale the R and C in the decreasing direction, in order to just meet the spec in the worst-

    case. This can be expresses as:

    Note that the only thing matters is scaling down the RC product, so in this case, we choose

    to keep R at its maximum value of 100k, in order to minimize total capacitance. Also notethat by doing this we still maintain the Butterworth shape of our filter in the nominal case,

    since Q is unaffected.

    The nominal component values we get are:

    For the first stage, For the second stage,

  • 7/22/2019 HW03 Solutions boser

    5/20

    EE247

    B. E. Boser Page 5 of 20

    Last modified 9/14/2011 4:08:00PM

    The minimum frequency that the filter can guarantee stopband attenutation to be 45 dB is

    when both R and C decrease. From the plot, we find fsminto be: The MATLAB code to rescale the component value and to generate the plot is shown

    below.

    %% Rescale R's and C's to account for the worst-case, in which R and C% are both too larges1c1 = s1c1/1.1/1.15s1c2 = s1c2/1.1/1.15s2c1 = s2c1/1.1/1.15s2c2 = s2c2/1.1/1.15

    figure(2)hold on;i = 2;%Worst-case variation%when i = 1, both R and C decrease%when i = 2, nominal case%when i = 3,fori=[1:3]

    rvar=[0.85 1 1.15];cvar=[0.9 1 1.1];

    s1r1var = rvar(i)*s1r1;s1r2var = rvar(i)*s1r2;

  • 7/22/2019 HW03 Solutions boser

    6/20

    EE247

    B. E. Boser Page 6 of 20

    Last modified 9/14/2011 4:08:00PM

    s1c1var = cvar(i)*s1c1;s1c2var = cvar(i)*s1c2;s2r1var = rvar(i)*s2r1;s2r2var = rvar(i)*s2r2;s2c1var = cvar(i)*s2c1;s2c2var = cvar(i)*s2c2;

    wp1 = 1/sqrt(s1r1var*s1c1var*s1r2var*s1c2var);Qp1 = wp1/(1/(s1r1var*s1c1var)+1/(s1r2var*s1c1var));h1 = tf([1], [(1/wp1)^2 1/(wp1*Qp1) 1]);wp2 = 1/sqrt(s2r1var*s2c1var*s2r2var*s2c2var);Qp2 = wp1/(1/(s2r1var*s2c1var)+1/(s2r2var*s2c1var));h2 = tf([1], [(1/wp2)^2 1/(wp2*Qp2) 1]);sys = zpk(h1*h2);

    f = logspace(5, 7, 2000);w = 2*pi*f;[mag, phase] = bode(sys, w);db = 20*log10(squeeze(mag));angle = squeeze(phase);

    %Generate the magnitude plot wizth annotation, phasesubplot(2,1,1),set(gca, 'fontsize', 14);semilogx(f, db, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]')axis([min(f) max(f) mindB maxdB]);

    %both R and C decrease, draw 45dB lineif(i == 1)

    ind = find (db < -45, 1, 'first');H = line( [min(f) f(ind)], ...

    [-45 -45], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [f(ind) f(ind)], ...

    [-45 mindB], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');disp('fsmin='), disp(f(ind));

    %both R and C increaseelseif(i == 3)

    ind = find (db > -ripple, 1, 'last');H = line( [min(f) f(ind)], ...

    [-ripple -ripple], 'LineStyle', ':','LineWidth', 2, 'Color','r');

    H = line( [f(ind) f(ind)], ...[-ripple mindB], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');

    H = line( [min(f) max(f)], ...[0 0], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');

    end

    subplot(2,1,2),set(gca, 'fontsize', 14);semilogx(f, angle, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Phase [degrees]')axis([min(f) max(f) -400 100])

    end

    subplot(2,1,1); grid;subplot(2,1,2); grid;

  • 7/22/2019 HW03 Solutions boser

    7/20

    EE247

    B. E. Boser Page 7 of 20

    Last modified 9/14/2011 4:08:00PM

    c) Enter the final circuit schematic in Virtuoso (or any other tool you like) and perform acsimulations for the nominal component sizes you re-scaled in part b. Also perform two more

    simulations using the worst-case variations of R and C that result in the minimum and

    maximum passband frequency. Submit a plot showing the filters magnitude response for allthree cases in one diagram. Clearly annotate the passband specifications as well as fsmin.

    Submit a plot of the complete filter schematic.Note:

    i. Dynamic range scaling or Biquad ordering is not required for this problem.ii. In Virtuoso, you may use design variables to scale component values more easily.

    The nominal component values are below:

    For the first stage, For the second stage,

    The lowest passband-frequency case (increase R by 15%, increase C by 10%)The largest fsmincase (decrease R by 15%, decrease C by 10%)

    The plot of all three cases is shown below. Two things to note here:

    i. The variation of the component values are accomplished by a parametric set sweepin Cadence ADE. To learn how to do this, refer to the Virtuoso Analog Design

    Environment User Guide (p.420).

    ii. In this case, the Spectre simulation result is imported into MATLAB using theSpectreRF MATLAB Toolbox. The plot is then created in MATLAB. The

    MATLAB code to for this is also shown. Of course, the curves can also be plotted

    in Cadence.

  • 7/22/2019 HW03 Solutions boser

    8/20

    EE247

    B. E. Boser Page 8 of 20

    Last modified 9/14/2011 4:08:00PM

    %% Grabbing data from Cadence simulation directoryclear all; close all;

    simDir =

    ;s=cds_srr(simDir,'sweep1_ac-sweep','out');

    f = s.value(1).YVec.value.YVec.freq;magdb(1,:) = 20*log10(abs(s.value(1).YVec.value.YVec.V));magdb(2,:) = 20*log10(abs(s.value(2).YVec.value.YVec.V));magdb(3,:) = 20*log10(abs(s.value(3).YVec.value.YVec.V));

    %% Plottingfigure(1);mindB = -80; maxdB = 5;ripple = 0.5;fori=1:3

    db = magdb(i,:);%Generate the magnitude plot wizth annotationset(gca, 'fontsize', 14);semilogx(f, db, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]')axis([min(f) max(f) mindB maxdB]);

    %both R and C decrease, draw 45dB lineif(i == 1)

    ind = find (db < -45, 1, 'first');H = line( [min(f) f(ind)], ...

  • 7/22/2019 HW03 Solutions boser

    9/20

    EE247

    B. E. Boser Page 9 of 20

    Last modified 9/14/2011 4:08:00PM

    [-45 -45], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [f(ind) f(ind)], ...

    [-45 mindB], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');disp('fsmin='), disp(f(ind));

    %both R and C increaseelseif(i == 3)

    ind = find (db > -ripple, 1, 'last');H = line( [min(f) f(ind)], ...[-ripple -ripple], 'LineStyle', ':','LineWidth', 2, 'Color',

    'r');H = line( [f(ind) f(ind)], ...

    [-ripple mindB], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [min(f) max(f)], ...

    [0 0], 'LineStyle', ':','LineWidth', 2, 'Color', 'r');end

    end

    outin out

    I2

    gain_ideal

    G: 1

    in out

    I0

    gain_ideal

    G: 1

    s2c1

    C3

    s2c2

    C2

    s1c2

    C1

    s1c1

    C0

    R3

    s2r1

    R2

    s2r2

    R1

    s1r2

    R0

    s1r1

    V0

    acm:1vdc:0

    3. Design a filter with the following response:

    a) What kind of a filter is this (low-pass, band-pass, etc.)? Solve for the poles and zeroes(i.e. find the real and imaginary component of all poles and zeroes). Then find the Q of

    each complex conjugate pole. Plot the pole-zero diagram.

    This filter is a high-pass filter. You can see this from viewing the magnitude responsecurve, but also from the pole-zero plot as well.

  • 7/22/2019 HW03 Solutions boser

    10/20

    EE247

    B. E. Boser Page 10 of 20

    Last modified 9/14/2011 4:08:00PM

    The pole zero plot shows there is one zero at the origin and no zeroes or poles at infinity.

    This would seem to indicate a high pass filter.

    Poles Zeros

    -1.726e7 0

    -2.502e6 i7.997e6 i4.6648e6

    -3.57e5 i6.281e6 i3.2296e6

    b) Plot the magnitude response using MATLAB. What are the filters passband edgefrequency, passband ripple, and stopband attenuation?

    passband edge = 1 MHz

    passband ripple = 1 dB

    stopband attenuation = 45 dB

  • 7/22/2019 HW03 Solutions boser

    11/20

    EE247

    B. E. Boser Page 11 of 20

    Last modified 9/14/2011 4:08:00PM

    MATLAB code is shown here:clear all; close all;s = zpk('s')sys = s*(s^2+2.176e13)*(s^2+1.043e13) ...

    / ((s+1.726e7)*(s^2+5.005e6*s+7.021e13)*(s^2+7.148e5*s+3.958e13));

    [z,p,k] = zpkdata(sys);z = z{1};p = p{1};figure(1);w_limit_x = 2e7;w_limit_y = 2e7;set(gca, 'fontsize', 14);

    %plot pole-zero diagramplot(p,'x','linewidth',2),hold on,plot(z,'o','linewidth',2);axis([-w_limit_x w_limit_x -w_limit_y w_limit_y]), axis square;xlabel('\sigma'),ylabel('j\omega'),title('Complex s-plane')

    grid on%find Q values of each pole pairQp1 = 1/(2*(-real(p(2))/abs(p(2))))Qp2 = 1/(2*(-real(p(4))/abs(p(4))))

    f = logspace(5, 7, 3000);[mag, phase] = bode(sys, 2*pi*f);db = 20*log10(reshape(mag, 1, length(f)));angle = squeeze(phase);

    %Plot the magnitude response to find the -3dB frequency and

  • 7/22/2019 HW03 Solutions boser

    12/20

    EE247

    B. E. Boser Page 12 of 20

    Last modified 9/14/2011 4:08:00PM

    %stop band edge%Generate the magnitude plot with annotation, phase,%and group delay plotsmindB = -80; maxdB = 5;figure(2);set(gca, 'fontsize', 14);

    semilogx(f, db, 'linewidth', 2), hold on;xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]')axis([min(f) max(f) mindB maxdB]),grid;

    %draws vertical line intersecting 3-dB pointind = find (db > -3, 1, 'first');H = line( [f(ind) f(ind)], [mindB -3], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');H = line( [min(f) max(f)], [0 0], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');

    %draws horizontal line showing passband ripple%estimate of passband frequency, doesn't need to be perfect%but should be outside of the transition bandf_passband = 1e6;%find max ripple for frequencies greater than 1.03e6ripple = -min(db(find(f>f_passband)))H = line( [f_passband max(f)], [-ripple -ripple], ...

    'LineStyle', ':','LineWidth', 2, 'Color', 'r');

    %draw horizontal line showing stopband attenuation%estimate of stopband frequency, doesn't need to be perfect but should %beoutside of the transition bandf_stopband = 7.667e5attenuation = -max(db(find(f

  • 7/22/2019 HW03 Solutions boser

    13/20

    EE247

    B. E. Boser Page 13 of 20

    Last modified 9/14/2011 4:08:00PM

  • 7/22/2019 HW03 Solutions boser

    14/20

    EE247

    B. E. Boser Page 14 of 20

    Last modified 9/14/2011 4:08:00PM

    MATLAB code is here:%% try changing the high-Q poles[z,p,k] = zpkdata(sys);z = z{1};p = p{1};

    p(4) = 1.05*p(4)p(5) = 1.05*p(5)sys_newhiQ = zpk(z,p,k);

    f = logspace(5, 7, 3000);[mag_newhiQ, phase_newhiQ] = bode(sys_newhiQ, 2*pi*f);db_newhiQ = 20*log10(reshape(mag_newhiQ, 1, length(f)));

    %Plot the magnitude response to find the -3dB frequency and stop band edge%Generate the magnitude plot with annotation, original curve will be dashedmindB = -80; maxdB = 5;figure(3)set(gca, 'fontsize', 14);

    semilogx(f, db_newhiQ, f, db, '--', 'linewidth', 2);xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]');title('Varying the high-Q poles');legend('Original: dashed','Location','SouthEast');axis([min(f) max(f) mindB maxdB]),grid;

    %% now change the low-Q pole pair[z,p,k] = zpkdata(sys);z = z{1};p = p{1};p(2) = 1.05*p(2);p(3) = 1.05*p(3);sys_newloQ = zpk(z,p,k);

    f = logspace(5, 7, 3000);[mag_newloQ, phase_newloQ] = bode(sys_newloQ, 2*pi*f);db_newloQ = 20*log10(reshape(mag_newloQ, 1, length(f)));

    %Plot the magnitude response to find the -3dB frequency and stop band edge%Generate the magnitude plot with annotation, original curve will be dashedmindB = -80; maxdB = 5;figure(4)set(gca, 'fontsize', 14);semilogx(f, db_newloQ, f, db, '--', 'linewidth', 2);xlabel('Frequency [Hz]'),ylabel('Magnitude [dB]');title('Varying the Low-Q poles');

    legend('Original: dashed','Location','SouthEast');axis([min(f) max(f) mindB maxdB]),grid;

    d) Realize the filter with a cascade of Tow-Thomas biquads and a single active first-ordersection that you will have to invent yourself. Use C=100 pF for all capacitors. Choose

    k1=k2=1 and R8=10k. Choose the gains such that the peak magnitude response is one

    (0 dB) for all amplifier outputs. Verify your result using Virtuoso/Spectre (or any other

    tool you like) and compare with MATLAB by finding the passband edge, the passbandripple, and stopband attenuation. Build the Tow-Thomas stages such that the complex

  • 7/22/2019 HW03 Solutions boser

    15/20

    EE247

    B. E. Boser Page 15 of 20

    Last modified 9/14/2011 4:08:00PM

    pole pair with the highest Q is paired with the zero pair nearest to it and order the filter

    stages from lowest Q to highest Q. Submit a plot showing the overall magnitude

    response as well as the responses at each stage output in the same plot. You will likely

    want to write MATLAB scripts to find the required gain and create your plots.

    Note: Use the same gain-ideal component as in Problem 1.

    First Stage: an active first order high pass filter

    s

    -------------

    (s+1.726e007)

    Yes, there is an inversion but it is okay. If the students use a passive high pass filter with

    a unity gain buffer, in order to get non-inverting gain, this is okay. However, it is not

    ideal because the filter would be sensitive to parasitics.

    For active 1st-order HPF, there are at least two configurations either by using 1 R and 2

    Cs, or by using 2 R and 1C. They implement the same transfer function. But the 1R2C

    circuit is preferred since capacitors have better matching characteristics.

    Component Values

    s1 =

    sys: [1x1 zpk]

    num: [1 0]

    den: [1 17260000]

    C: 1.0000e-010

    R: 579.3743

    For the 2nd

    and 3rd

    stage, DR scaling is required. This is done in MATLAB. Maximum

    value in magnitude response of the combined 1stand 2

    ndstage is found first, and the 2

    nd

    stage transfer function is then simply scaled down by this factor. Same for the 3rd

    stage.

    For the 2nd

    and 3rd

    stage, we also need to do DR scaling for the internal nodes. First using

    k1=k2=1 to calculate the component values, then scale k1 and k2 based on the peak

    frequency response of the internal nodes, and re-calculate all the component values.

    Second Stage: Tow-thomas filter

    (s^2 + 1.043e013)

    ------------------------------

    (s^2 + 5.005e006s + 7.021e013)

    Component Values (Solve for the component values using the equations on Chapter 2,

    Slide 24, by initially using k1=k2=1. )

    Frequency response of the internal nodes (1stand 3

    rdamplifier) is shown:

  • 7/22/2019 HW03 Solutions boser

    16/20

    EE247

    B. E. Boser Page 16 of 20

    Last modified 9/14/2011 4:08:00PM

    Final component values:

    s2 =

    sys: [1x1 zpk]

    sys_drs: [1x1 zpk]

    num: [1.0003 0 1.0433e+013]

    den: [1 5.0050e+006 7.0210e+013]

    k1: 0.6437

    k2: 1.3149

    C: 1.0000e-010

    R1: 1.9980e+003

    R2: 768.2464

    R3: 1.4099e+003

    R4: 1.5191e+003

    R5: 5.1702e+003

    R8: 10000

    R6: 9.9974e+003

    R7: 1.3149e+004

  • 7/22/2019 HW03 Solutions boser

    17/20

    EE247

    B. E. Boser Page 17 of 20

    Last modified 9/14/2011 4:08:00PM

    Third Stage: Tow-thomas filter

    (s^2 + 2.176e013)

    ------------------------------

    (s^2 + 7.148e005s + 3.958e013)

    Frequency response of the internal nodes (1

    st

    and 3

    rd

    amplifier) is shown below:

    Rescale k1 and k2, then compute the final component values:

    s3 =

    sys: [1x1 zpk]

    num: [0.9999 0 2.1758e+013]

    den: [1 7.1480e+005 3.9580e+013]

    sys_drs: [1x1 zpk]

    k1: 0.9378

    k2: 1.0565

    C: 1.0000e-010

    R1: 1.3990e+004R2: 1.4906e+003

    R3: 1.6044e+003

    R4: 1.3243e+004

    R5: 2.7115e+003

    R8: 10000

    R6: 1.0001e+004

    R7: 1.0565e+004

  • 7/22/2019 HW03 Solutions boser

    18/20

    EE247

    B. E. Boser Page 18 of 20

    Last modified 9/14/2011 4:08:00PM

    MATLAB code is here:%% pole-zero grouping[z,p,k]=zpkdata(sys); z=z{1}; p=p{1};% Group p2,p3 with z4, z5 (high-Q pole with nearby zero)s1.sys=zpk(z(1), p(1),1);s2.sys=zpk(z(2:3),p(4:5),1); % Low Q stage first

    s3.sys=zpk(z(4:5),p(2:3),1);[s3.num, s3.den]=zp2tf(z(2:3),p(4:5),1);%% First stage, using 1R and 2C, C=100pF[num, den]=tfdata(s1.sys);s1.num = num{1};s1.den = den{1};s1.C=100e-12;s1.R=1/s1.den(2)/s1.C;%% 2nd stagesys12 = s1.sys * s2.sys;f = logspace(6,8,2000);[mag,phase]=bode(sys12,2*pi*f);maxmag = max(mag);s2.sys_drs = s2.sys/maxmag;[num, den]=tfdata(s2.sys_drs);s2.num = num{1};s2.den = den{1};a2=s2.den(1); a1=s2.den(2); a0=s2.den(3);b2=s2.num(1); b1=s2.num(2); b0=s2.num(3);k2=1/(10^(-2.378/20)); k1=10^(-3.826/20);s2.k1=k1; s2.k2=k2;s2.C=100e-12;s2.R1=1/a1/s2.C;s2.R2=k1/sqrt(a0)/s2.C;s2.R3=1/k1/k2/sqrt(a0)/s2.C;s2.R4=1/k2/(a1*b2-b1)/s2.C;s2.R5=k1*sqrt(a0)/b0/s2.C;s2.R8=10e3;

    s2.R6=s2.R8/b2;s2.R7=k2*s2.R8;%% 3rd stagesys123 = s1.sys * s2.sys_drs * s3.sys;f = logspace(6,8,2000);[mag,phase]=bode(sys123,2*pi*f);maxmag = max(mag);s3.sys_drs = s3.sys/maxmag;[num, den]=tfdata(s3.sys_drs);s3.num = num{1};s3.den = den{1};a2=s3.den(1); a1=s3.den(2); a0=s3.den(3);b2=s3.num(1); b1=s3.num(2); b0=s3.num(3);k1=10^(-558e-3/20); k2=1/(10^(-477.1e-3/20));s3.k1 = k1; s3.k2=k2;s3.C=100e-12;s3.R1=1/a1/s3.C;s3.R2=k1/sqrt(a0)/s3.C;s3.R3=1/k1/k2/sqrt(a0)/s3.C;s3.R4=1/k2/(a1*b2-b1)/s3.C;s3.R5=k1*sqrt(a0)/b0/s3.C;s3.R8=10e3;s3.R6=s3.R8/b2;s3.R7=k2*s3.R8;s1, s2, s3

  • 7/22/2019 HW03 Solutions boser

    19/20

    EE247

    B. E. Boser Page 19 of 20

    Last modified 9/14/2011 4:08:00PM

    Magnitude response of output of each stage (plotted using SpectreRF MATLAB Toolbox):

    passband edge= 1 MHz

    passband ripple = 1dB

    stopband attenuation = 45 dB

    Below is a plot of the scaled amplifier outputs of stage 2 and stage 3.

  • 7/22/2019 HW03 Solutions boser

    20/20

    EE247

    B. E. Boser Page 20 of 20

    PM

    Below is the schematic:

    Stage 1:

    s1out

    in out

    I8

    gain_ideal

    G: -1e10

    R16

    s1r

    s1c

    C5

    s1c

    C4

    V0

    acm:1vdc:1

    Stage2:

    s2out

    s1out

    in out

    I2

    gain_ideal

    G: -1e10

    in out

    I1

    gain_ideal

    G: -1e10

    in out

    I0

    gain_ideal

    G: -1e10

    R7

    s2r3

    R6

    s2r1

    R5

    s2r5

    R4

    s2r6

    R3

    s2r4

    R2

    s2r2

    R1

    s2r8

    R0

    s2r7

    s2c2

    C1

    s2c1

    C0

    Stage 3:

    s2out

    s3out

    in out

    I7

    gain_ideal

    G: -1e10

    in out

    I6

    gain_ideal

    G: -1e10

    in out

    I4

    gain_ideal

    G: -1e10

    R15

    s3r7

    R14

    s3r8

    R13

    s3r2

    R12

    s3r6

    R11

    s3r5

    R10

    s3r1

    R9

    s3r3

    R8

    s3r4

    s3c1

    C3

    s3c2

    C2