Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
Chebyshev

Language Guide / Signal Modifiers · Generated namespace reference

Chebyshev

klang::Filters::Chebyshev

Type I and Type II Chebyshev filters.

Select Type I or Type II with Chebyshev<1> or Chebyshev<2>. Both use a second-order prototype. Each provides LPF, HPF, BPF, and BRF. The band responses are fourth order.

Type I allows ripple in the passband for a sharper transition. Its edge is specified at the passband ripple limit, and the default ripple is 1 dB. Type II keeps the passband monotonic and allows ripple in the stopband. Its edge is specified at the stopband attenuation limit, and the default attenuation is 40 dB.

Example · Type I low-pass

Declare Chebyshev<1>::LPF filter;. Pass the passband edge in Hz and optionally the ripple as dB(1).

in >> filter(1200, dB(1)) >> out;

Example · Type II band-reject

Declare Chebyshev<2>::BRF notch;. Pass the lower and upper stopband edges in Hz and optionally the minimum attenuation as dB(40).

in >> notch(45, 55, dB(40)) >> out;

Repeated settings preserve the filter history and reuse the coefficients. reset() clears the history and keeps the configuration.