# cheb1ord

Design a Chebyshev I filter.

## Syntax

[n,Wn] = cheb1ord(Wp,Ws,Rp,Rs,domain)

## Inputs

`Wp`- A scalar specifying the passband frequency of a low or high pass filter, or a two element vector specifying the passband frequencies of a bandpass or bandstop filter. For a digital filter the values (in Hz) are normalized relative to the Nyquist frequency. For an analog filter the values are in radians/sec.
`Ws`- A scalar specifying the stopband frequency of a low or high pass filter, or a two element vector specifying the stopband frequencies of a bandpass or bandstop filter. For a digital filter the values (in Hz) are normalized relative to the Nyquist frequency. For an analog filter the values are in radians/sec.
`Rp`- The maximum attenuation in decibels at
`Wp`. `Rs`- The minimum attenuation in decibels at
`Ws`. `domain`-
- Use 'z' for digital filters (default).
- Use 's' for analog filters.

## Outputs

- n
- The lowest filter order that will meet the requirements.
- Wn
- Normalized frequency input for which the requirement is met.

## Example

Design a digital Chebyshev I filter with no more than 1 dB attenuation at 100 Hz and at least 20 dB attenuation at 200 Hz, with a 1000 Hz sampling frequency.

`[n,Wn] = cheb1ord(100/500, 200/500, 1, 20)`

```
n = 3
Wn = 0.2392
```

## Comments

In general, there are a range of corner frequencies for which the requirements can be met
at the lowest order. `Wp` is the smallest passband meeting the design requirement.
`Wn` is the largest passband meeting the design requirement.