KFR

FIR functions

fir

template<typename T, typename E1, size_t Tag>
internal::expression_fir<T, value_type_of<E1>, E1> fir(E1 &&e1, const univector<T, Tag> &taps)

Returns template expression that applies FIR filter to the input

Parameters:
  • e1 – an input expression
  • taps – coefficients for the FIR filter

Source:

template <typename T, typename E1, size_t Tag>
CMT_INLINE internal::expression_fir<T, value_type_of<E1>, E1> fir(E1&& e1, const univector<T, Tag>& taps)
template<typename T, typename U, typename E1>
internal::expression_fir<T, U, E1, true> fir(fir_state<T, U> &state, E1 &&e1)

Returns template expression that applies FIR filter to the input

Parameters:
  • state – FIR filter state
  • e1 – an input expression

Source:

template <typename T, typename U, typename E1>
CMT_INLINE internal::expression_fir<T, U, E1, true> fir(fir_state<T, U>& state, E1&& e1)

short_fir

template<typename T, size_t TapCount, typename E1>
internal::expression_short_fir<next_poweroftwo(TapCount), T, value_type_of<E1>, E1> short_fir(E1 &&e1, const univector<T, TapCount> &taps)

Returns template expression that applies FIR filter to the input (count of coefficients must be in

range 2..32)

Parameters:
  • e1 – an input expression
  • taps – coefficients for the FIR filter

Source:

template <typename T, size_t TapCount, typename E1>
CMT_INLINE internal::expression_short_fir<next_poweroftwo(TapCount), T, value_type_of<E1>, E1> short_fir(
    E1&& e1, const univector<T, TapCount>& taps)

reset

void reset() final

Reset internal filter state

Source:

void reset() final

fir_lowpass

template<typename T, size_t Tag>
void fir_lowpass(univector<T, Tag> &taps, identity<T> cutoff, const expression_pointer<T> &window, bool normalize = true)

Calculates coefficients for the low-pass FIR filter

Parameters:
  • taps – array where computed coefficients are stored
  • cutoff – Normalized frequency (frequency_Hz / samplerate_Hz)
  • window – pointer to a window function
  • normalize – true for normalized coefficients

Source:

template <typename T, size_t Tag>
CMT_INLINE void fir_lowpass(univector<T, Tag>& taps, identity<T> cutoff, const expression_pointer<T>& window,
                            bool normalize = true)

fir_highpass

template<typename T, size_t Tag>
void fir_highpass(univector<T, Tag> &taps, identity<T> cutoff, const expression_pointer<T> &window, bool normalize = true)

Calculates coefficients for the high-pass FIR filter

Parameters:
  • taps – array where computed coefficients are stored
  • cutoff – Normalized frequency (frequency_Hz / samplerate_Hz)
  • window – pointer to a window function
  • normalize – true for normalized coefficients

Source:

template <typename T, size_t Tag>
CMT_INLINE void fir_highpass(univector<T, Tag>& taps, identity<T> cutoff, const expression_pointer<T>& window,
                             bool normalize = true)

fir_bandpass

template<typename T, size_t Tag>
void fir_bandpass(univector<T, Tag> &taps, identity<T> frequency1, identity<T> frequency2, const expression_pointer<T> &window, bool normalize = true)

Calculates coefficients for the band-pass FIR filter

Parameters:
  • taps – array where computed coefficients are stored
  • frequency1 – Normalized frequency (frequency_Hz / samplerate_Hz)
  • frequency2 – Normalized frequency (frequency_Hz / samplerate_Hz)
  • window – pointer to a window function
  • normalize – true for normalized coefficients

Source:

template <typename T, size_t Tag>
CMT_INLINE void fir_bandpass(univector<T, Tag>& taps, identity<T> frequency1, identity<T> frequency2,
                             const expression_pointer<T>& window, bool normalize = true)

fir_bandstop

template<typename T, size_t Tag>
void fir_bandstop(univector<T, Tag> &taps, identity<T> frequency1, identity<T> frequency2, const expression_pointer<T> &window, bool normalize = true)

Calculates coefficients for the band-stop FIR filter

Parameters:
  • taps – array where computed coefficients are stored
  • frequency1 – Normalized frequency (frequency_Hz / samplerate_Hz)
  • frequency2 – Normalized frequency (frequency_Hz / samplerate_Hz)
  • window – pointer to a window function
  • normalize – true for normalized coefficients

Source:

template <typename T, size_t Tag>
CMT_INLINE void fir_bandstop(univector<T, Tag>& taps, identity<T> frequency1, identity<T> frequency2,
                             const expression_pointer<T>& window, bool normalize = true)

fir_lowpass

template<typename T>
void fir_lowpass(const univector_ref<T> &taps, identity<T> cutoff, const expression_pointer<T> &window, bool normalize = true)

@copydoc kfr::fir_lowpass

Source:

template <typename T>
CMT_INLINE void fir_lowpass(const univector_ref<T>& taps, identity<T> cutoff,
                            const expression_pointer<T>& window, bool normalize = true)

fir_highpass

template<typename T>
void fir_highpass(const univector_ref<T> &taps, identity<T> cutoff, const expression_pointer<T> &window, bool normalize = true)

@copydoc kfr::fir_highpass

Source:

template <typename T>
CMT_INLINE void fir_highpass(const univector_ref<T>& taps, identity<T> cutoff,
                             const expression_pointer<T>& window, bool normalize = true)

fir_bandpass

template<typename T>
void fir_bandpass(const univector_ref<T> &taps, identity<T> frequency1, identity<T> frequency2, const expression_pointer<T> &window, bool normalize = true)

@copydoc kfr::fir_bandpass

Source:

template <typename T>
CMT_INLINE void fir_bandpass(const univector_ref<T>& taps, identity<T> frequency1, identity<T> frequency2,
                             const expression_pointer<T>& window, bool normalize = true)

fir_bandstop

template<typename T>
void fir_bandstop(const univector_ref<T> &taps, identity<T> frequency1, identity<T> frequency2, const expression_pointer<T> &window, bool normalize = true)

@copydoc kfr::fir_bandstop

Source:

template <typename T>
CMT_INLINE void fir_bandstop(const univector_ref<T>& taps, identity<T> frequency1, identity<T> frequency2,
                             const expression_pointer<T>& window, bool normalize = true)