Engee documentation

ellip

Calculation of an elliptical filter.

Library

EngeeDSP

Syntax

Function call

  • b, a = ellip(n, Rp, Rs, Wp) — designs a digital elliptical low-pass filter n-th order with a normalized bandwidth boundary frequency Wp. The resulting filter has a ripple size in the bandwidth Rp dB and attenuation in the delay band Rs dB relative to the peak value in the bandwidth. Function ellip returns the coefficients of the numerator and denominator of the filter transfer function.

  • b, a = ellip(n, Rp, Rs, Wp, ftype) — designs a digital elliptical filter: low-pass filter, high-pass filter, bandpass filter or notch filter, depending on the value of the argument ftype and the number of elements Wp. The resulting designs of the bandpass and notch filters are of the following order 2n.

  • z, p, k = ellip(_) — Designs a digital elliptical filter and returns its zeros, poles, and gain. This syntax can include any input arguments from the previous options.

  • A, B, C, D = ellip(_) — designs a digital elliptical filter and returns matrices that define its representation in the state space.

  • _ = ellip(_, "s") — designs an analog elliptical filter using any of the input or output arguments in the previous syntaxes.

Arguments

Input arguments

# n — filter order

+ scalar

Details

The filter order, specified as an integer scalar, is less than or equal to 500. For band-pass and notch filters n represents half of the filter order.

Data types

Float64

# Rp is the size of the ripples in the bandwidth in dB

+ positive scalar

Details

The size of the ripples in the bandwidth, set as a positive scalar in dB.

If the value is expressed in linear units, you can convert it to dB using the formula Rp .

Data types

Float64

# Rs — attenuation in the delay band in dB

+ positive scalar

Details

The attenuation in the delay band is relative to the peak value in the passband, set as a positive scalar in dB.

If the value is expressed in linear units, you can convert it to dB using the formula Rs .

Data types

Float64

# Wp — bandwidth limit frequency

+ scalar | two-element vector

Details

The bandwidth boundary frequency, defined as a scalar or a two-element vector. The bandwidth boundary frequency is the frequency at which the amplitude-frequency response of the filter is Rp in dB. Lower frequency response ripple values in the bandwidth, Rp, and large attenuation values in the delay band, Rs, lead to increased bandwidth.

  • If Wp — a scalar, then ellip designs a low-pass or high-pass filter with a cut-off frequency Wp.

    If Wp — two-element vector [w1 w2], where w1 < w2 Then ellip designs a bandpass or notch filter with a lower cut-off frequency w1 and the upper boundary frequency w2.

  • For digital filters, the bandwidth boundary frequencies should be in the range of 0 before 1, where 1 corresponds to the Nyquist frequency — half of the sampling frequency or rad/countdown.

    For analog filters, the bandwidth boundary frequencies must be expressed in rad/s and can take any positive value.

Data types

Float64

# ftype — filter type

+ "low" | "bandpass" | "high" | "stop"

Details

The filter type is set as:

  • "low" — low-pass filter with bandwidth boundary frequency Wp. This value is used by default for scalar Wp;

  • "high" — high-pass filter with bandwidth boundary frequency Wp;

  • "bandpass" — bandpass filter 2n of the order if Wp — a two-element vector. This value is used by default when Wp set as a two-element vector;

  • "stop" — notch (blocking) filter 2n of the order if Wp — a two-element vector.

Data types

String

Output arguments

# b, a are the coefficients of the transfer function

+ string vectors

Details

The coefficients of the filter transfer function are returned as row vectors. With the specified filter order n the function returns b and a with r by counting where r=n+1 for low and high pass filters and r=2*n+1 for band-pass and notch filters.

The transfer function is expressed in terms of and :

  • for digital filters

  • for analog filters

Data types

Float64

# z, p, k — zeros, poles, and gain

+ column vectors and scalar

Details

The zeros, poles, and gain of the filter are returned as two vectors-columns and a scalar. With the specified filter order n the function returns z and p with r by counting where r=n for low- and high-pass filters and r=2*n for band-pass and notch filters.

The transfer function is expressed in terms of , and :

  • for digital filters

  • for analog filters

Data types

Float64

# A, B, C, D — representation of the filter in the state space

+ matrices

Details

The representation of the filter in the state space, returned as matrices. If r = n for low and high pass filters and r = 2n for bandpass and notch filters, then A This is the matrix r on r, B the matrix r on 1, C the matrix 1 on r, and D1 on 1.

The state space matrices relate the state vector , entrance and the exit by means of systems of equations:

  • for digital filters

  • for analog filters

Data types

Float64

Algorithms

Elliptical filters have a steeper drop in performance than Butterworth or Chebyshev filters, but they have uniform pulsations in both the passband and the delay band. In general, elliptical filters correspond to the specified characteristics, having the lowest order among filters of any type.

Elliptical Filter ellip uses a five-step algorithm:

  • Finds the poles, zeros, and gain of the analog low-pass prototype.

  • Converts poles, zeros, and gain into a state space.

  • If necessary, it uses a state space transformation to convert a low-pass filter into a band-pass, high-pass, or notch filter with the required frequency constraints.

  • To design digital filters, it converts an analog filter to a digital one by means of a bilinear frequency pre-distortion conversion. Fine frequency tuning allows analog and digital filters to have the same frequency response amplitude Wp or w1 and w2.

  • If necessary, it converts the state space filter back into a transfer function or a zero-pole-gain form.

Literature

  1. Lyons, Richard G. Understanding Digital Signal Processing. Upper Saddle River, NJ: Prentice Hall, 2004.