Issue link: https://resources.pcb.cadence.com/i/1480195
APPLICATION NOTE 2 .SUBCKT butt_lp 1 2 params: Fc=1 ord=1 ;Subcircuit description .PARAM pi=3.14159 ;Constant .FUNC lp_1(x) {x/(s+x)} ;1st-order lowpass transfer function *a1-a4 and b1-b4 determine which filter sections are selected, given the filter order .PARAM a1={table(ord,1,1,2,0,3,1,4,0,5,1,6,0,7,1,8,0,9,1)} .PARAM a2={stp(ord-1.5)} .PARAM a3={stp(ord-3.5)} a4={stp(ord-5.5)} a5={stp(ord-7.5)} .PARAM b1={1-a1} b2={1-a2} b3={1-a3} b4={1-a4} b5={1-a5} *alpha, omega, and Q values of the Butterworth response for each section are looked up from these tables, based on the filter order. Upto 9th-order [ord] filter is allowed. .PARAM alpha_b={table(ord,1,1,2,0,3,1,4,0,5,1,6,0,7,1,8,0,9,1)} .PARAM omega1_b={table(ord,1,0,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1)} .PARAM Q1_b={table(ord,1,0,2,0.707,3,1,4,1.307,5,1.618,6,1.932,7,2.247,8,2.564,9,0.532)} .PARAM omega2_b={table(ord,3,0,4,1,5,1,6,1,7,1,8,1,9,1)} .PARAM Q2_b={table(ord,3,0,4,0.541,5,0.618,6,0.707,7,0.802,8,0.90,9,0.653)} .PARAM omega3_b={table(ord,5,0,6,1,7,1,8,1,9,1)} .PARAM Q3_b={table(ord,5,0,6,0.518,7,0.555,8,0.601,9,1)} .PARAM omega4_b={table(ord,7,0,8,1,9,1)} .PARAM Q4_b={table(ord,7,0,8,0.509,9,2.879)} E 2 0 LAPLACE {V(1)}={(b1+a1*lp_1(2*pi*alpha_b*Fc))* ;VCVS with laplace description + (b2+a2*lp_2(2*pi*omega1_b*Fc,Q1_b))* ;1st order +(b3+a3*lp_2(2*pi*omega2_b*Fc,Q2_b)) * ;2nd order +(b4+a4*lp_2(2*pi*omega3_b*Fc,Q3_b)) * +(b5+a5*lp_2(2*pi*omega4_b*Fc,Q4_b))} .ENDs butt_lp ;end with subcircuit description The model implements the overall voltage transfer function of the filter as shown in Figure 1 using a controlled voltage source (E component) that has the Laplace description. The model text shows that the model is limited to simulating a maximum of a ninth-order filter, which is made up of one first-order section and four second-order sections. It is often considered that a ninth-order filter is adequate for most applications. The filter model can easily be increased to simulate filters greater than 9th order by adding second-order sections. The transfer functions are specified through .FUNC statements. The parameters a1 through a4 and b1 through b4 determine which filter sections of the model are selected by using a simple selection algorithm, based on the order of the filter specified by the user. The selection algorithm is implemented using .PARAM statements as shown in the model text. The filter order is defined by the subcircuit parameter, ORD. Note that the PSpice function stp, which is used in the model, describes a step function where stp(x) is 1 if x>0 and is 0 otherwise. The α, ω, and Q values of the Butterworth response are defined as lookup tables using .PARAM statements. These values are looked up automatically given the order of the filter. The model is described as a sub-circuit called Butt_LP with the input at node in and the output at node out as shown in Figure 2. Figure 2: Lowpass Filter Circuit