kwave
18.07.70
|
#include <Filter.h>
Public Member Functions | |
Filter (int rate) | |
Filter (const QString &command) | |
virtual | ~Filter () |
QString | command () |
unsigned int | resize (unsigned int newnum) |
bool | isFIR () const |
int | rate () const |
unsigned int | count () |
double | coeff (unsigned int index) |
void | setCoeff (unsigned int index, double newval) |
unsigned int | delay (unsigned int index) |
void | setDelay (unsigned int index, unsigned int newval) |
void | load (const QString &filename) |
void | save (const QString &filename) |
Private Attributes | |
bool | m_fir |
unsigned int | m_rate |
QVector< double > | m_coeff |
QVector< int > | m_delay |
Holds a set of parameters for a digital IIR or FIR filter.
use KIONetAccess in the load/save methods
more error checks in load/save (current code is too optimistic)
|
explicit |
Constructor, creates an empty filter with a given sample rate.
rate | number of samples per second |
Definition at line 47 of file Filter.cpp.
|
explicit |
Constructor, creates a filter from a Kwave command string.
command | part of the Kwave command with parameters |
Definition at line 31 of file Filter.cpp.
References _, count(), m_coeff, m_delay, m_fir, m_rate, Kwave::Parser::nextParam(), resize(), Kwave::Parser::toDouble(), and Kwave::Parser::toInt().
|
virtual |
Destructor
Definition at line 53 of file Filter.cpp.
References resize().
double Kwave::Filter::coeff | ( | unsigned int | index | ) |
Returns a filter coefficient.
index | internal index [0...count-1] |
Definition at line 109 of file Filter.cpp.
References m_coeff, and Kwave::toInt().
Referenced by rate().
QString Kwave::Filter::command | ( | ) |
unsigned int Kwave::Filter::count | ( | ) |
unsigned int Kwave::Filter::delay | ( | unsigned int | index | ) |
Returns a delay time of the filter.
index | internal index [0...count-1] |
Definition at line 123 of file Filter.cpp.
References m_delay, and Kwave::toInt().
Referenced by rate().
|
inline |
void Kwave::Filter::load | ( | const QString & | filename | ) |
|
inline |
Returns the sample rate in samples/second
Definition at line 71 of file Filter.h.
References coeff(), count(), delay(), load(), m_rate, save(), setCoeff(), and setDelay().
unsigned int Kwave::Filter::resize | ( | unsigned int | newnum | ) |
Resizes the filter to a new number of coefficients.
newnum | new number of coefficients [1..] |
Definition at line 79 of file Filter.cpp.
References count(), m_coeff, m_delay, and Kwave::toInt().
Referenced by Filter(), load(), and ~Filter().
void Kwave::Filter::save | ( | const QString & | filename | ) |
Saves the filter parameters to a URL
Definition at line 137 of file Filter.cpp.
References _, count(), m_coeff, m_delay, m_fir, name, and Kwave::toInt().
Referenced by rate().
void Kwave::Filter::setCoeff | ( | unsigned int | index, |
double | newval | ||
) |
Sets a filter coefficient to a new value.
index | internal index [0...count-1] |
newval | new coefficient |
Definition at line 116 of file Filter.cpp.
References m_coeff, and Kwave::toInt().
Referenced by rate().
void Kwave::Filter::setDelay | ( | unsigned int | index, |
unsigned int | newval | ||
) |
Sets a delay value to a new value.
index | internal index [0...count-1] |
newval | new delay value |
Definition at line 130 of file Filter.cpp.
References m_delay, and Kwave::toInt().
Referenced by rate().
|
private |
|
private |
|
private |
|
private |