|
HARDT - The Ham Radio DSP Toolkit
|
#include <hmultiplier.h>


Public Member Functions | |
| HMultiplier (HReader< T > *reader, H_SAMPLE_RATE rate, int frequency, int oscillatorAmplitude, size_t blocksize, HProbe< T > *probe=NULL) | |
| HMultiplier (HWriter< T > *writer, H_SAMPLE_RATE rate, int frequency, int oscillatorAmplitude, size_t blocksize, HProbe< T > *probe=NULL) | |
| HMultiplier (HWriterConsumer< T > *consumer, H_SAMPLE_RATE rate, int frequency, int oscillatorAmplitude, size_t blocksize, HProbe< T > *probe=NULL) | |
| ~HMultiplier () | |
| void | Init (H_SAMPLE_RATE rate, int frequency, int oscillatorAmplitude, size_t blocksize) |
| int | Read (T *dest, size_t blocksize) |
| int | Write (T *src, size_t blocksize) |
| void | SetWriter (HWriter< T > *writer) |
| bool | Start () |
| bool | Stop () |
| void | SetFrequency (int frequency) |
| void | Mix (T *src, T *dest, size_t blocksize) |
| bool | Command (HCommand *command) |
Public Member Functions inherited from HReader< T > | |
| virtual | ~HReader ()=default |
| HReader< T > * | Reader () |
Public Member Functions inherited from HObject | |
| HObject () | |
Public Member Functions inherited from HWriter< T > | |
| virtual | ~HWriter ()=default |
| HWriter< T > * | Writer () |
Public Member Functions inherited from HWriterConsumer< T > | |
| HWriterConsumer< T > * | Consumer () |
Multiplier (unlinear mixer).
Will mix the input signal with a localoscillator signal thus producing (Tin + Tlo) and (Tin - Tlo)
The localoscillator frequency can be changed by calling SetFrequency(). behaviour while the frequency is transitioning is undefined, if you make large adjustments you may want to reduce the input level while setting the new frequency to avoid clicks or noise (check if it is a problem in your actual case)
The multiplier can be created with any amplitude of the local oscillator, but the output level is scaled down, so that the gain factor of the multiplier is always 1. So select a local oscillator amplitude that matches the input signal, and prevents internal overruns (AMPL_in * AMPL_lo <= max(T)/2)
| HMultiplier< T >::HMultiplier | ( | HReader< T > * | reader, |
| H_SAMPLE_RATE | rate, | ||
| int | frequency, | ||
| int | oscillatorAmplitude, | ||
| size_t | blocksize, | ||
| HProbe< T > * | probe = NULL |
||
| ) |
Construct a new HMultiplier (frequency mixer)
| HMultiplier< T >::HMultiplier | ( | HWriter< T > * | writer, |
| H_SAMPLE_RATE | rate, | ||
| int | frequency, | ||
| int | oscillatorAmplitude, | ||
| size_t | blocksize, | ||
| HProbe< T > * | probe = NULL |
||
| ) |
Construct a new HMultiplier (frequency mixer)
| HMultiplier< T >::HMultiplier | ( | HWriterConsumer< T > * | consumer, |
| H_SAMPLE_RATE | rate, | ||
| int | frequency, | ||
| int | oscillatorAmplitude, | ||
| size_t | blocksize, | ||
| HProbe< T > * | probe = NULL |
||
| ) |
Construct a new HMultiplier (frequency mixer)
| HMultiplier< T >::~HMultiplier |
Default destructor
|
inlinevirtual |
Execute or carry through a command
Implements HReader< T >.
| void HMultiplier< T >::Init | ( | H_SAMPLE_RATE | rate, |
| int | frequency, | ||
| int | oscillatorAmplitude, | ||
| size_t | blocksize | ||
| ) |
Common initialization tasks
| void HMultiplier< T >::Mix | ( | T * | src, |
| T * | dest, | ||
| size_t | blocksize | ||
| ) |
Mix two signals
|
virtual |
Read a block of samples
Implements HReader< T >.
| void HMultiplier< T >::SetFrequency | ( | int | frequency | ) |
Set the frequency of the local oscillator that feeds one of the inputs of the mixer
|
inlinevirtual |
Set writer
Implements HWriterConsumer< T >.
|
virtual |
Initialize before first read
Reimplemented from HReader< T >.
|
virtual |
Cleanup after last read
Reimplemented from HReader< T >.
|
virtual |
Write a block of samples
Implements HWriter< T >.
1.8.17