Skip to main content

CosineFilter

Namespace: UTILSLIB  ·  Library: Utilities Library

#include <utils/cosinefilter.h>

class UTILSLIB::CosineFilter

Creates a cosine filter response in the frequency domain.

Creates a cosine filter response in the frequency domain.

src/examples/ex_dsp_filter/main.cpp
// CosineFilter works in absolute Hz: low-pass edge 40 Hz with a 10 Hz slope, FFT length 1024
CosineFilter cosineLp(1024, 40.0f, 10.0f, 0.0f, 0.0f, kSFreq, CosineFilter::LPF);
const RowVectorXcd& response = cosineLp.m_vecFftCoeff; // one-sided response, bin k at k * 1000 / 1024 Hz

Public Methods​

CosineFilter()​

Constructs a CosineFilter object.


CosineFilter(fftLength, lowpass, lowpass_width, highpass, highpass_width, sFreq, type)​

Constructs a CosineFilter object.

Parameters:

  • fftLength : int length of the fft (multiple integer of 2^x).

  • lowpass : float low cutoff frequency in Hz (not normed to sampling freq).

  • lowpass_width : float determines the width of the filter slopes (steepness) in Hz (not normed to sampling freq).

  • highpass : float highpass high cutoff frequency in Hz (not normed to sampling freq).

  • highpass_width : float determines the width of the filter slopes (steepness) in Hz (not normed to sampling freq).

  • sFreq : double sampling frequency.

  • type : TPassType filter type (lowpass, highpass, etc.).


Example​

Authors of this file​