scitex_dsp.utils.filter

Functions

design_filter(sig_len, fs[, low_hz, ...])

Designs a Finite Impulse Response (FIR) filter based on the specified parameters.

plot_filter_responses(filter, fs[, worN, title])

Plots the impulse and frequency response of an FIR filter using numpy arrays.

scitex_dsp.utils.filter.design_filter(sig_len, fs, low_hz=None, high_hz=None, cycle=3, is_bandstop=False)[source]

Designs a Finite Impulse Response (FIR) filter based on the specified parameters.

Arguments: - sig_len (int): Length of the signal for which the filter is being designed. - fs (int): Sampling frequency of the signal. - low_hz (float, optional): Low cutoff frequency for the filter. Required for lowpass and bandpass filters. - high_hz (float, optional): High cutoff frequency for the filter. Required for highpass and bandpass filters. - cycle (int, optional): Number of cycles to use in determining the filter order. Defaults to 3. - is_bandstop (bool, optional): Specifies if the filter should be a bandstop filter. Defaults to False.

Returns: - The coefficients of the designed FIR filter.

Raises: - FilterParameterError: If the provided parameters are invalid.

scitex_dsp.utils.filter.plot_filter_responses(filter, fs, worN=8000, title=None)[source]

Plots the impulse and frequency response of an FIR filter using numpy arrays.

Parameters: - filter_coeffs (numpy.ndarray): The filter coefficients as a numpy array. - fs (int): The sampling frequency in Hz. - title (str, optional): The title of the plot. Defaults to None.

Returns: - matplotlib.figure.Figure: The figure object containing the impulse and frequency response plots.