FilterGen  1.0.0
A library to design digital filters in embedded systems.
dh_filter_parameters Struct Reference

#include <dh/filter-types.h>

Public Attributes

double cutoff_frequency_low
 
double cutoff_frequency_high
 
double sampling_frequency
 
double ripple
 
size_t filter_order
 
DH_FILTER_TYPE filter_type
 

Detailed Description

The structure defining the parameters for a filter that will be created with dh_create_filter().

Member Data Documentation

◆ cutoff_frequency_high

double dh_filter_parameters::cutoff_frequency_high

The second cutoff frequency of the filter.

This value is used to configure the upper cutoff frequencies for bandpass and bandstop filters. The value represents the upper end (cutoff_frequency_low_hz<cutoff_frequency_high_hz must be true) of the band.

This parameter is used for the following filters:

*_BANDPASS, *_BANDSTOP

Valid Range:

  • [cutoff_frequency_low, sampling_frequency/2]

Unit:

  • Any frequency - but cutoff_frequency_low, cutoff_frequency_high and sampling_frequency must have the same unit.

◆ cutoff_frequency_low

double dh_filter_parameters::cutoff_frequency_low

The first cutoff frequency of the filter.

This value is used to configure the cutoff frequencies for lowpass and highpass filters. For bandpass and bandstop filters, the value represents the lower end (cutoff_frequency_low_hz<cutoff_frequency_high_hz must be true) of the band.

This parameter is used for the following filters:

DH_FIR_EXPONENTIAL_MOVING_AVERAGE_LOWPASS, DH_FIR_BRICKWALL_*, DH_IIR_EXPONENTIAL_*, DH_IIR_BUTTERWORTH_*, DH_IIR_CHEBYSHEV_*

Valid Range:

  • [0, sampling_frequency/2] or [0, cutoff_frequency_high/2]

Unit:

  • Any frequency, but cutoff_frequency_low, cutoff_frequency_high and sampling_frequency must have the same unit.

◆ filter_order

size_t dh_filter_parameters::filter_order

The order of the filter.

This value determines the number of input and output coefficients in the recurrence relation of the filter.

This parameter is used by every filter except:

Valid Range:

  • [0, inf]

Unit:

  • none

◆ filter_type

DH_FILTER_TYPE dh_filter_parameters::filter_type

What filter to generate. Valid values are defined in the enum DH_FILTER_TYPE.

◆ ripple

double dh_filter_parameters::ripple

The ripple of chebyshev filters.

This value is used during configuration to shift the poles of the chebyshev filters.

This parameter is used for the following filters:

CHEBYSHEV

Valid Range:

  • [-inf, 0]

Unit:

  • dB

◆ sampling_frequency

double dh_filter_parameters::sampling_frequency

The sampling rate for data supplied to the filter.

This value is used during configuration to scale the cutoff frequencies and then compute the values. The filter itself does not depend on timings, and e.g. a lowpass with 10Hz cutoff and 100Hz sampling rate will have the exact same parameters as one with 20kHz cutoff and 200kHz sampling rate.

This parameter is used for the following filters:

BRICKWALL, EXPONENTIAL, CHEBYSHEV, BUTTERWORTH

Valid Range:

  • [0, inf]

Unit:

  • Any frequency - but cutoff_frequency_low, cutoff_frequency_high and sampling_frequency must have the same unit.

The documentation for this struct was generated from the following file:
DH_IIR_EXPONENTIAL_LOWPASS
@ DH_IIR_EXPONENTIAL_LOWPASS
Definition: filter-types.h:40
DH_FIR_EXPONENTIAL_MOVING_AVERAGE_LOWPASS
@ DH_FIR_EXPONENTIAL_MOVING_AVERAGE_LOWPASS
Definition: filter-types.h:30
DH_NO_FILTER
@ DH_NO_FILTER
Definition: filter-types.h:24