EDN logo


Design Ideas: January 6, 1994

Spice subcircuit simulates any second-order filter

Horace T Jones,
Rockville, MD

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 call—in this case, a lowpass filter—you 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 1—Constants for Filters
Filter type k2k1k0Gain
Lowpass001.0 at dc
Bandpass001.0 at Fp
Highpass001.0 at infinity
Notch0(Fz/Fp)2k0 at dc,
1.0 at infinity
Allpass-11.0 at all frequencies
BumpNote 11.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


| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas |


Copyright © 1994 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.