kwave
18.07.70
|
#include <NotchFilter.h>
Public Slots | |
void | input (Kwave::SampleArray data) |
void | setFrequency (const QVariant fc) |
void | setBandwidth (const QVariant bw) |
Signals | |
void | output (Kwave::SampleArray data) |
![]() | |
void | attributeChanged (const QVariant value) |
Public Member Functions | |
NotchFilter () | |
virtual | ~NotchFilter () Q_DECL_OVERRIDE |
virtual void | goOn () Q_DECL_OVERRIDE |
virtual double | at (double f) Q_DECL_OVERRIDE |
![]() | |
SampleSource (QObject *parent=Q_NULLPTR) | |
virtual | ~SampleSource () |
virtual bool | done () const |
![]() | |
StreamObject (QObject *parent=Q_NULLPTR) | |
virtual | ~StreamObject () |
virtual unsigned int | tracks () const |
virtual Kwave::StreamObject * | operator[] (unsigned int track) |
virtual unsigned int | tracksOfPort (const char *port) const |
virtual Kwave::StreamObject * | port (const char *port, unsigned int track) |
virtual unsigned int | blockSize () const |
void | setAttribute (const char *attribute, const QVariant &value) |
![]() | |
virtual | ~TransmissionFunction () |
Private Member Functions | |
void | initFilter () |
void | setfilter_peaknotch2 (double freq, double bw) |
Private Attributes | |
Kwave::SampleArray | m_buffer |
double | m_f_cutoff |
double | m_f_bw |
struct { | |
double cx | |
double cx1 | |
double cx2 | |
double cy1 | |
double cy2 | |
double x | |
double x1 | |
double x2 | |
double y | |
double y1 | |
double y2 | |
} | m_filter |
Additional Inherited Members | |
![]() | |
static void | setInteractive (bool interactive) |
Definition at line 35 of file NotchFilter.h.
Kwave::NotchFilter::NotchFilter | ( | ) |
Constructor
Definition at line 28 of file NotchFilter.cpp.
References initFilter().
|
virtual |
|
virtual |
Implements Kwave::TransmissionFunction.
Definition at line 47 of file NotchFilter.cpp.
References m_filter.
|
virtual |
does the calculation
Implements Kwave::SampleSource.
Definition at line 41 of file NotchFilter.cpp.
References m_buffer, and output().
|
private |
reset/initialize the filter coefficients
Definition at line 84 of file NotchFilter.cpp.
References m_filter.
Referenced by NotchFilter(), setBandwidth(), and setFrequency().
|
slot |
receives input data
Definition at line 120 of file NotchFilter.cpp.
References double2sample(), m_buffer, m_f_bw, m_f_cutoff, m_filter, Kwave::SampleArray::resize(), sample2double(), setfilter_peaknotch2(), and Kwave::SampleArray::size().
|
signal |
emits a block with the filtered data
Referenced by goOn().
|
slot |
Sets the bandwidth, normed to [0...2Pi]. The calculation is: bw = bandwidth [Hz] * 2 * Pi / f_sample [Hz]. The default setting is 0.1.
Definition at line 159 of file NotchFilter.cpp.
References initFilter(), m_f_bw, m_f_cutoff, and setfilter_peaknotch2().
Referenced by Kwave::NotchFilterDialog::updateDisplay().
|
private |
set the coefficients for a given frequency
freq | normed frequency |
bw | normed bandwidth |
Definition at line 98 of file NotchFilter.cpp.
References m_filter.
Referenced by input(), setBandwidth(), and setFrequency().
|
slot |
Sets the center frequency, normed to [0...2Pi]. The calculation is: fc = frequency [Hz] * 2 * Pi / f_sample [Hz]. The default setting is 0.5.
Definition at line 148 of file NotchFilter.cpp.
References initFilter(), m_f_bw, m_f_cutoff, and setfilter_peaknotch2().
Referenced by Kwave::NotchFilterDialog::updateDisplay().
double Kwave::NotchFilter::cx |
Definition at line 102 of file NotchFilter.h.
double Kwave::NotchFilter::cx1 |
Definition at line 102 of file NotchFilter.h.
double Kwave::NotchFilter::cx2 |
Definition at line 102 of file NotchFilter.h.
double Kwave::NotchFilter::cy1 |
Definition at line 102 of file NotchFilter.h.
double Kwave::NotchFilter::cy2 |
Definition at line 102 of file NotchFilter.h.
|
private |
|
private |
bandwidth of the notch
Definition at line 98 of file NotchFilter.h.
Referenced by input(), setBandwidth(), and setFrequency().
|
private |
cutoff frequency [0...PI]
Definition at line 95 of file NotchFilter.h.
Referenced by input(), setBandwidth(), and setFrequency().
struct { ... } Kwave::NotchFilter::m_filter |
structure with the filter coefficients
Referenced by at(), initFilter(), input(), and setfilter_peaknotch2().
double Kwave::NotchFilter::x |
Definition at line 103 of file NotchFilter.h.
double Kwave::NotchFilter::x1 |
Definition at line 103 of file NotchFilter.h.
double Kwave::NotchFilter::x2 |
Definition at line 103 of file NotchFilter.h.
double Kwave::NotchFilter::y |
Definition at line 103 of file NotchFilter.h.
double Kwave::NotchFilter::y1 |
Definition at line 103 of file NotchFilter.h.
double Kwave::NotchFilter::y2 |
Definition at line 103 of file NotchFilter.h.