Documentation

cheb1ord

Chebyshev Type I filter order

Description

example

[n,Wp] = cheb1ord(Wp,Ws,Rp,Rs)returns the lowest ordernof the Chebyshev Type I filter that loses no more thanRpdB in the passband and has at leastRsdB of attenuation in the stopband. The scalar (or vector) of corresponding cutoff frequenciesWpis also returned.

[n,Wp] = cheb1ord(Wp,Ws,Rp,Rs,'s')designs a lowpass, highpass, bandpass, or bandstop analog Chebyshev Type I filter with cutoff angular frequenciesWp.

Examples

collapse all

For data sampled at 1000 Hz, design a lowpass filter with less than 3 dB of ripple in the passband defined from 0 to 40 Hz and at least 60 dB of ripple in the stopband defined from 150 Hz to the Nyquist frequency.

Wp = 40/500; Ws = 150/500; Rp = 3; Rs = 60; [n,Wp] = cheb1ord(Wp,Ws,Rp,Rs)
n = 4
Wp = 0.0800
[b,a] = cheby1(n,Rp,Wp); freqz(b,a,512,1000) title('n = 4 Chebyshev Type I Lowpass Filter')

Design a bandpass filter with a passband of 60 Hz to 200 Hz, with less than 3 dB of ripple in the passband and 40 dB attenuation in the stopbands that are 50 Hz wide on both sides of the passband.

Wp = [60 200]/500; Ws = [50 250]/500; Rp = 3; Rs = 40; [n,Wp] = cheb1ord(Wp,Ws,Rp,Rs)
n = 7
Wp =1×20.1200 0.4000
[b,a] = cheby1(n,Rp,Wp); freqz(b,a,512,1000) title('n = 7 Chebyshev Type I Bandpass Filter')

Input Arguments

collapse all

通频带有限公司rner (cutoff) frequency, specified as a scalar or a two-element vector with values between 0 and 1 inclusive, with 1 corresponding to the normalized Nyquist frequency,πrad/sample. For digital filters, the unit of passband corner frequency is in radians per sample. For analog filters, passband corner frequency is in radians per second, and the passband can be infinite. The values ofWpandWsdetermine the type of filter cheb1ord returns:

  • IfWpandWsare both scalars andWp<Ws, thencheb1ordreturns the order and cutoff frequency of a lowpass filter. The stopband of the filter ranges fromWsto 1, and the passband ranges from 0 toWp.

  • IfWpandWsare both scalars andWp>Ws, thencheb1ordreturns the order and cutoff frequency of a highpass filter. The stopband of the filter ranges from 0 toWs, and the passband ranges fromWpto 1.

  • IfWpandWsare both vectors and the interval specified byWscontains the interval specified byWp(Ws(1)<Wp(1)<Wp(2)<Ws(2)), thencheb1ordreturns the order and cutoff frequencies of a bandpass filter. The stopband of the filter ranges from 0 toWs(1)and fromWs(2)to 1. The passband ranges fromWp(1)toWp(2).

  • IfWpandWsare both vectors and the interval specified byWpcontains the interval specified byWs(Wp(1)<Ws(1)<Ws(2)<Wp(2)), thencheb1ordreturns the order and cutoff frequencies of a bandstop filter. The stopband of the filter ranges fromWs(1)toWs(2). The passband ranges from 0 toWp(1)and fromWp(2)to 1.

    Use the following guide to specify filters of different types.

    Filter Type Stopband and Passband Specifications

    Filter Type

    Stopband and Passband Conditions

    Stopband

    Passband

    Lowpass

    Wp<Ws, both scalars

    (Ws,1)

    (0,Wp)

    Highpass

    Wp>Ws, both scalars

    (0,Ws)

    (Wp,1)

    Bandpass

    The interval specified byWscontains the one specified byWp(Ws(1) < Wp(1) < Wp(2) < Ws(2)).

    (0,Ws(1))and(Ws(2),1)

    (Wp(1),Wp(2))

    Bandstop

    The interval specified byWpcontains the one specified byWs(Wp(1) < Ws(1) < Ws(2) < Wp(2)).

    (0,Wp(1))and(Wp(2),1)

    (Ws(1),Ws(2))

Data Types:single|double

Note

如果你的过滤器规格要求带通or bandstop filter with unequal ripples in each of the passbands or stopbands, design separate lowpass and highpass filters and cascade the two filters together.

Stopband corner frequency, specified as a scalar or a two-element vector with values between 0 and 1 inclusive, with 1 corresponding to the normalized Nyquist frequency.

  • For digital filters, stopband corner frequency is in radians per sample.

  • For analog filters, stopband corner frequency is in radians per second and the stopband can be infinite.

Note

The values ofWpandWsdetermine the filter type.

Passband ripple, specified as a scalar in dB.

Data Types:single|double

Stopband attenuation, specified as a scalar in dB.

Data Types:single|double

Output Arguments

collapse all

Lowest filter order, returned as an integer scalar.

通频带有限公司rner frequency, returned as a scalar or a two-element vector. Use the output argumentsnandWpwith thecheby2function.

Algorithms

cheb1orduses the Chebyshev lowpass filter order prediction formula described in[1]. The function performs its calculations in the analog domain for both analog and digital cases. For the digital case, it converts the frequency parameters to thes-domain before the order and natural frequency estimation process, and then converts them back to thez-domain.

cheb1ordinitially develops a lowpass filter prototype by transforming the passband frequencies of the desired filter to 1 rad/s (for lowpass or highpass filters) or to -1 and 1 rad/s (for bandpass or bandstop filters). It then computes the order and natural frequency required for a lowpass filter to match the passband specification exactly when using the values in thecheby1function.

References

[1] Rabiner, Lawrence R., and Bernard Gold.Theory and Application of Digital Signal Processing.Englewood Cliffs, NJ: Prentice-Hall, 1975.

Extended Capabilities

Introduced before R2006a