Practical Analog and Digital Filter Design

Appendix F: C Code for Active Filter Implementation

In order to aid in the implementation and evaluation of analog active filters, we will now develop the code necessary for the calculation of component values and the generation of PSpice text files. These text files will serve as input to PSpice that will analyze the active filters.

We will use two structures to pass information to the various functions in this project. The first structure is the familiar Filt_Params structure, discussed previously. The second is a new structure used to hold the component values for the active filters to be designed. This RC_Comps structure is shown below and includes the voltage divider resistors R x and R y as well as the number of stages in the filter. The other variables contained in the structure are pointers to arrays because these variables will be present in each stage of the filter and we will not know at the time of the program execution how many stages will be present. The components included are the primary R and C values, the gain control resistors R A and R B, and the bandstop parameters R o and C o.

typedef struct{ double  Rx,Ry,    /*  Voltage divider values */          *R,*C,    /*  Primary R-C values */          *Ra,*Rb,  /*  Feedback resistors */   ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: IC Electronic Filters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.