LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches

Base class for all periodic signals (that are exactly periodic based on the sampling frequency). Note that the sine wave generator is not exactly periodic as the frequency can be any floating point value. More...

#include <lasp_siggen_impl.h>

Inheritance diagram for Periodic:
Collaboration diagram for Periodic:

Public Member Functions

vd getSequence () const
 Return copy of the generated sequence.
 
virtual vd genSignalUnscaled (const us nframes) override final
 
 ~Periodic ()=default
 
- Public Member Functions inherited from Siggen
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.
 

Protected Attributes

vd _signal { 1, arma::fill::zeros}
 
us _cur_pos = 0
 
- Protected Attributes inherited from Siggen
std::mutex _mtx
 
_fs = 0
 

Additional Inherited Members

- Protected Member Functions inherited from Siggen
virtual void resetImpl ()=0
 

Detailed Description

Base class for all periodic signals (that are exactly periodic based on the sampling frequency). Note that the sine wave generator is not exactly periodic as the frequency can be any floating point value.

Definition at line 62 of file lasp_siggen_impl.h.

Constructor & Destructor Documentation

◆ ~Periodic()

Periodic::~Periodic ( )
default

Member Function Documentation

◆ genSignalUnscaled()

vd Periodic::genSignalUnscaled ( const us  nframes)
finaloverridevirtual

Implements Siggen.

Definition at line 43 of file lasp_siggen_impl.cpp.

◆ getSequence()

vd Periodic::getSequence ( ) const
inline

Return copy of the generated sequence.

Returns
As stated above

Definition at line 72 of file lasp_siggen_impl.h.

Member Data Documentation

◆ _cur_pos

us Periodic::_cur_pos = 0
protected

Definition at line 65 of file lasp_siggen_impl.h.

◆ _signal

vd Periodic::_signal { 1, arma::fill::zeros}
protected

Definition at line 64 of file lasp_siggen_impl.h.


The documentation for this class was generated from the following files: