Signal generation abstract base class. Implementation is required for resetImpl(), genSignalUnscaled() and destructor.
More...
#include <lasp_siggen.h>
|
virtual | ~Siggen ()=default |
|
void | setFilter (const std::string &name, std::shared_ptr< Filter > f) |
| Set a filter on the signal. For example to EQ the signal, or otherwise to shape the spectrum. Filters are stored in a map, and setFilter can be used to overwrite them, if a null pointer is given.
|
|
void | setDCOffset (d offset) |
| Set a linear DC offset value to the signal.
|
|
void | setMute (bool mute=true) |
| Mute the signal. Passes through the DC offset. No lock is hold. If it just works one block later, than that is just the case.
|
|
void | setLevel (const d level, bool dB=true) |
| Set the level of the signal generator.
|
|
void | reset (const d newFs) |
| Reset the signal generator. Should be called whenever the output is based on a different sampling frequency. Note that derived classes from this class should call the base class!
|
|
vd | genSignal (const us nframes) |
| Called whenever the implementation needs to create new samples.
|
|
Signal generation abstract base class. Implementation is required for resetImpl(), genSignalUnscaled() and destructor.
Definition at line 23 of file lasp_siggen.h.
◆ ~Siggen()
virtual Siggen::~Siggen |
( |
| ) |
|
|
virtualdefault |
◆ genSignal()
vd Siggen::genSignal |
( |
const us |
nframes | ) |
|
Called whenever the implementation needs to create new samples.
- Parameters
-
- Returns
- Array of samples with length nframes
Definition at line 15 of file lasp_siggen.cpp.
◆ genSignalUnscaled()
virtual vd Siggen::genSignalUnscaled |
( |
const us |
nframes | ) |
|
|
protectedpure virtual |
◆ reset()
void Siggen::reset |
( |
const d |
newFs | ) |
|
Reset the signal generator. Should be called whenever the output is based on a different sampling frequency. Note that derived classes from this class should call the base class!
- Parameters
-
newFs | New sampling frequency to use. |
Definition at line 54 of file lasp_siggen.cpp.
◆ resetImpl()
virtual void Siggen::resetImpl |
( |
| ) |
|
|
protectedpure virtual |
◆ setDCOffset()
void Siggen::setDCOffset |
( |
d |
offset | ) |
|
Set a linear DC offset value to the signal.
- Parameters
-
Definition at line 44 of file lasp_siggen.cpp.
◆ setFilter()
void Siggen::setFilter |
( |
const std::string & |
name, |
|
|
std::shared_ptr< Filter > |
f |
|
) |
| |
Set a filter on the signal. For example to EQ the signal, or otherwise to shape the spectrum. Filters are stored in a map, and setFilter can be used to overwrite them, if a null pointer is given.
- Parameters
-
name | The name of the filter (i.e. "noiseshaper", or "eq" |
f | The filter to install. |
Definition at line 34 of file lasp_siggen.cpp.
◆ setLevel()
void Siggen::setLevel |
( |
const d |
level, |
|
|
bool |
dB = true |
|
) |
| |
Set the level of the signal generator.
- Parameters
-
level | The new level. If dB == true, it is treated as a level, and pow(10, level/20) is installed as the linear gain. |
dB | if false, level is treated as linear gain value. |
Definition at line 49 of file lasp_siggen.cpp.
◆ setMute()
void Siggen::setMute |
( |
bool |
mute = true | ) |
|
|
inline |
Mute the signal. Passes through the DC offset. No lock is hold. If it just works one block later, than that is just the case.
- Parameters
-
Definition at line 62 of file lasp_siggen.h.
◆ _fs
◆ _mtx
The documentation for this class was generated from the following files: