FilterParameter
Namespace: UTILSLIB · Library: Utilities Library
#include <utils/filterkernel.h>
class UTILSLIB::FilterParameter
Named filter-design parameter descriptor holding a human-readable name and description (e.g.
design method or filter type).
src/examples/ex_dsp_filter/main.cpp
// Frequencies are normalised to Nyquist (500 Hz): 40 Hz cut-off, 10 Hz transition
const int typeLpf = FilterKernel::m_filterTypes.indexOf(FilterParameter("LPF"));
const int cosine = FilterKernel::m_designMethods.indexOf(FilterParameter("Cosine"));
const int tschebyscheff = FilterKernel::m_designMethods.indexOf(FilterParameter("Tschebyscheff"));
FilterKernel lowPass("lp40", typeLpf, 256, 40.0 / 500.0, 0.0, 10.0 / 500.0, kSFreq, cosine);
FilterKernel lowPassPm("lp40pm", typeLpf, 256, 40.0 / 500.0, 0.0, 10.0 / 500.0, kSFreq, tschebyscheff);
Public Methods
FilterParameter()
Creates a filter parameter with name 'Unknown'.
FilterParameter(sName)
Creates a filter parameter with name sName.
Parameters:
- sName : QString input name.
FilterParameter(sName, sDescription)
Creates a filter parameter with name sName and description sDescription.
Parameters:
-
sName : QString input name.
-
sDescription : QString input desxription.
getName()
Returns parameter name.
Returns:
- QString — Parameter name.
Example
- Full source:
src/examples/ex_dsp_filter/main.cpp - Build target:
ex_dsp_filter(runs under CTest)
Used in examples
ex_filtering
Example for filtering data with a user defined FIR filter and writing the result to a file.
src/examples/ex_filtering/main.cpp, line 89
printf("Filtering...");
if (RTPROCESSINGLIB::filterFile(fileOut,
pRaw,
FilterKernel::m_filterTypes.indexOf(FilterParameter("BPF")),
10,
10,
0.1,
pRaw->info.sfreq,
1024,
UTILSLIB::FilterKernel::m_designMethods.indexOf(FilterParameter("Cosine")),
picks)) {
printf("[done]\n");
} else {
printf("[failed]\n");
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>