ezmsg.sigproc.cheby#

Functions

cheby_design_fun(fs, order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, coef_type='ba', cheby_type='cheby1', wn_hz=True)[source]#

Chebyshev type I and type II digital and analog filter design. Design an order`th-order digital or analog Chebyshev type I or type II filter and return the filter coefficients. See :obj:`ChebyFilterSettings for argument description.

Returns:

The filter coefficients as a tuple of (b, a) for coef_type “ba”, or as a single ndarray for “sos”, or (z, p, k) for “zpk”.

Parameters:
Return type:

tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]] | None

Classes

class ChebyshevFilter(*args, settings=None, **kwargs)[source]#

Bases: BaseFilterByDesignTransformerUnit[ChebyshevFilterSettings, ChebyshevFilterTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of ChebyshevFilterSettings

class ChebyshevFilterSettings(axis=None, coef_type='ba', order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, cheby_type='cheby1', wn_hz=True)[source]#

Bases: FilterBaseSettings

Settings for ChebyshevFilter.

Parameters:
order: int = 0#

Filter order

ripple_tol: float | None = None#

The maximum ripple allowed below unity gain in the passband. Specified in decibels, as a positive number.

Wn: float | tuple[float, float] | None = None#

A scalar or length-2 sequence giving the critical frequencies. For Type I filters, this is the point in the transition band at which the gain first drops below -rp. For digital filters, Wn are in the same units as fs unless wn_hz is False. For analog filters, Wn is an angular frequency (e.g., rad/s).

btype: str = 'lowpass'#

{‘lowpass’, ‘highpass’, ‘bandpass’, ‘bandstop’}

analog: bool = False#

When True, return an analog filter, otherwise a digital filter is returned.

cheby_type: str = 'cheby1'#

Which type of Chebyshev filter to design. Either “cheby1” or “cheby2”.

__init__(axis=None, coef_type='ba', order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, cheby_type='cheby1', wn_hz=True)#
Parameters:
Return type:

None

wn_hz: bool = True#

Set False if provided Wn are normalized from 0 to 1, where 1 is the Nyquist frequency

class ChebyshevFilterTransformer(*args, **kwargs)[source]#

Bases: FilterByDesignTransformer[ChebyshevFilterSettings, tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]]]

get_design_function()[source]#

Return a function that takes sampling frequency and returns filter coefficients.

Return type:

Callable[[float], tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]] | None]

class ChebyshevFilterSettings(axis=None, coef_type='ba', order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, cheby_type='cheby1', wn_hz=True)[source]#

Bases: FilterBaseSettings

Settings for ChebyshevFilter.

Parameters:
order: int = 0#

Filter order

ripple_tol: float | None = None#

The maximum ripple allowed below unity gain in the passband. Specified in decibels, as a positive number.

Wn: float | tuple[float, float] | None = None#

A scalar or length-2 sequence giving the critical frequencies. For Type I filters, this is the point in the transition band at which the gain first drops below -rp. For digital filters, Wn are in the same units as fs unless wn_hz is False. For analog filters, Wn is an angular frequency (e.g., rad/s).

btype: str = 'lowpass'#

{‘lowpass’, ‘highpass’, ‘bandpass’, ‘bandstop’}

analog: bool = False#

When True, return an analog filter, otherwise a digital filter is returned.

cheby_type: str = 'cheby1'#

Which type of Chebyshev filter to design. Either “cheby1” or “cheby2”.

__init__(axis=None, coef_type='ba', order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, cheby_type='cheby1', wn_hz=True)#
Parameters:
Return type:

None

wn_hz: bool = True#

Set False if provided Wn are normalized from 0 to 1, where 1 is the Nyquist frequency

cheby_design_fun(fs, order=0, ripple_tol=None, Wn=None, btype='lowpass', analog=False, coef_type='ba', cheby_type='cheby1', wn_hz=True)[source]#

Chebyshev type I and type II digital and analog filter design. Design an order`th-order digital or analog Chebyshev type I or type II filter and return the filter coefficients. See :obj:`ChebyFilterSettings for argument description.

Returns:

The filter coefficients as a tuple of (b, a) for coef_type “ba”, or as a single ndarray for “sos”, or (z, p, k) for “zpk”.

Parameters:
Return type:

tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]] | None

class ChebyshevFilterTransformer(*args, **kwargs)[source]#

Bases: FilterByDesignTransformer[ChebyshevFilterSettings, tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]]]

get_design_function()[source]#

Return a function that takes sampling frequency and returns filter coefficients.

Return type:

Callable[[float], tuple[ndarray[tuple[Any, …], dtype[_ScalarT]], ndarray[tuple[Any, …], dtype[_ScalarT]]] | ndarray[tuple[Any, …], dtype[_ScalarT]] | None]

class ChebyshevFilter(*args, settings=None, **kwargs)[source]#

Bases: BaseFilterByDesignTransformerUnit[ChebyshevFilterSettings, ChebyshevFilterTransformer]

Parameters:

settings (Settings | None)

SETTINGS#

alias of ChebyshevFilterSettings