Practical Analog and Digital Filter Design

Appendix E: C Code for Unnormalized Approximation Functions

The Unnormalize_Coefs, which is given in Listing E.1, first determines the variables used for unnormalization. The unnormalization frequency freq for lowpass and highpass, as well as the center frequency Wo and the bandwidth BW for bandpass and bandstop cases are determined differently for the inverse Chebyshev case as compared to the other approximation methods. After these calculations, the appropriate unnormalization function is chosen based on the selectivity of the filter. Each of the specific functions called uses the Filt_Params structure pointer FP as well as the appropriate unnormalization variables. Any errors that occur in the functions are handled in the manner described in Appendix D to allow easy identification of the location of the problem.

Listing E.1: Unnormalize_Coefs function.
/*====================================================  Unnormalize_Coefs() - converts normal lowpass coefs              to unnormalized LP/HP/BP/BS.  Prototype:  int Unnormalize_Coefs(Filt_Params *FP);  Return:     error value  Arguments:  FP - ptr to struct holding filter params====================================================*/int Unnormalize_Coefs(Filt_Params *FP){ int     Error;    /*  error value */  double  freq, /*  unnormalizing freq for LP & HP  */          BW,   /*  unnormal. bandwidth for BP & BS */          Wo;   /*  unnormal. ctr freq for BP & BS  */  /*...

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: Protective Relays and Monitoring Relays
Finish!
Privacy Policy

This is embarrasing...

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