bmwsky
New Member
Offline
Posts: 7
|
Dear All I've already read the "Simulating switch-capacitor filters with SpectreRF" written by Ken Kundert. And I found two questions that I can't settle.
1. In the guide, Ken give the SH VerilogA model below: ------------------------------------------------------------- `include "discipline.h" `include "constants.h"
module sh (Pout, Nout, Pin, Nin);
input Pin, Nin; output Pout, Nout; electrical Pin, Nin, Pout, Nout; parameter real period=1 from (0:inf); parameter real tdelay=0 from [0:inf); parameter real aperture=period/100 from (0:period/2); parameter real tc=aperture/10 from (0:aperture);
integer n; real tstart, tstop; electrical hold;
analog begin
// Determine the point where the aperture begins; n = ($abstime - tdelay + aperture) / period + 0.5; tstart = n*period + tdelay - aperture; @(timer(tstart));
// Determine the time where the aperture ends; n = ($abstime - tdelay) / period + 0.0; tstop = n*period + tdelay; @(timer(tstop));
// Implement switch with effective series resistence of 1 Ohm if (($abstime > tstop - aperture) && ($abstime <= tstop)) I(hold) <+ V(hold) - V(Pin, Nin); else I(hold) <+ 1.0e-12 * V(hold);
// Implement capacitor with an effective capacitance of tc I(hold) <+ tc * ddt(V(hold));
// Buffer output V(Pout, Nout) <+ V(hold);
// Control time step tightly during aperture and loosely otherwise if (($abstime >= tstop - aperture) && ($abstime < tstop)) begin $bound_step(tc); end else begin $bound_step(period/5); end
end endmodule --------------------------------------------- why he use the "tc=aperture/10 "to set the capacitor? why not use a fixed capacitor??
2. In the guide, he told that if you would like to check the discrete time Gain response of the SC circuit, you should add a sample and hold circuit as described above. However, due to the sinc function of the SH, the output of the continues gain checked by PAC will change, esspecially the NULL point of the sinc. So, my question is how to check the discrete response by SpectreRF without adding a SH circuit after the output??
Thank you!!!
BMWSKY
|