To create an elliptic filter with a bandstop in MATLAB, you can use the ellip function. Here's an example code snippet:
main.m715 chars17 lines
In this example, Fs is the sampling frequency, fstop1 and fstop2 are the frequencies to be attenuated, fpass1 and fpass2 are the frequencies to be passed, Astop1 and Astop2 are the attenuation levels in the stop bands, and Apass is the ripple in the passband.
The ellip function computes the filter coefficients for the two separate bandpass filters, and the conv function is used to combine the two in a bandstop configuration. Finally, the fvtool function is used to generate the frequency response of the filter.
Note that the ellip function requires the Signal Processing Toolbox.
gistlibby LogSnag