The Spice subcircuit filter in Listing 1, along with the appropriate constants drawn from Table 1, simulates any second-order filter. The subcircuit in the Listing runs under MicroSim's (Irvine, CA) pSpice. To calculate the parameters that the subcircuit needs, begin with the classical transfer function for a filter
where, because Spice accepts only unsubscripted Latin letters, Wp substitutes for the pole frequency vPOLE, Qp for QPOLE, and Fp for FPOLE. Similarly, Wz is the Spice-compatible symbol for the frequency of the zero vZERO, and Qz for QZERO.
In a typical subcircuit callin this case, a lowpass filteryou need to supply values only for the constants Table 1 specifies. Listing 1 supplies default values for k2, k1, and k0 on its first line.
Table 1Constants for Filters | ||||
---|---|---|---|---|
Filter type | k2 | k1 | k0 | Gain |
Lowpass | 0 | 0 | | 1.0 at dc |
Bandpass | 0 | | 0 | 1.0 at Fp |
Highpass | | 0 | 0 | 1.0 at infinity |
Notch | | 0 | (Fz/Fp)2 | k0 at dc, 1.0 at infinity |
Allpass | | -1 | | 1.0 at all frequencies |
Bump | | Note 1 | | 1.0 at dc and infinity, |k1| at Fp |
Note 1: Set k1 for the bump filter (or equalizer) equal to your desired gain at Fp. The magnitude of k1 may be greater than or less than 1.0. The amplitude response will be the same for +k1 or -k1, but the envelope delay will be different. | ||||
Note 2: "" indicates that no entry is needed. |
The ASCII file, DI1347.TXT, attached to the message /DI_SIG #1347, contains a copy of the subcircuit.
EDN BBS /DI_SIG #1347