sgnts.filtertools
¶
Utilities for creating, modifying, and applying filters to data.
Largely wrappers around scipy.signal functions, but with some additional functionality for working with filters in the context of sgnts.
low_pass_filter(f_cutoff, f_sample, size=None, n_zeros=None, win_func=None, normalize=True, fix_size=None)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_cutoff
|
int
|
|
required |
f_sample
|
int
|
|
required |
size
|
Optional[int]
|
|
None
|
n_zeros
|
Optional[int]
|
|
None
|
win_func
|
Optional[Callable]
|
Callable, a window function to apply to the filter. Typically a function from scipy.signal.windows. Default is None, which applies no window function. Function MUST accept a single argument, M, which is the number of taps in the filter. |
None
|
Returns:
Source code in src/sgnts/filtertools.py
sinc_sample_size(f_cutoff, f_sample, n_zeros)
¶
Compute the sample size for a sinc filter with the given cutoff frequency, sample rate, and number of zeros.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_cutoff
|
int
|
int, the cutoff frequency of the sinc filter |
required |
f_sample
|
int
|
int, the sample rate of the data to which the filter will be applied |
required |
n_zeros
|
int
|
int, the number of zeros in the sinc filter |
required |
Returns:
| Type | Description |
|---|---|
int
|
int, the sample size of the sinc filter |