![]() |
SoDaRadio-12.2.0-cut_dependencies:6c82803
|
sin/cos oscillator to drive TX signal chain More...
#include <QuadratureOscillator.hxx>
Public Member Functions | |
| QuadratureOscillator () | |
| Constructor. | |
| std::complex< double > | stepOscCD () |
| step the oscillator and produce a complex double result | |
| std::complex< double > | stepOscCD_sincos () |
| std::complex< double > | stepOscCD_complex () |
| std::complex< float > | stepOscCF () |
| step the oscillator and produce a complex float result | |
| double | stepOscD () |
| step the oscillator and produce a real double result | |
| void | setPhaseIncr (double _pi) |
| set the phase increment per step for the oscillator (1/freq) | |
Private Attributes | |
| double | phase_incr |
| double | ang |
| std::complex< double > | ejw |
| std::complex< double > | last |
| int | idx |
sin/cos oscillator to drive TX signal chain
Definition at line 38 of file QuadratureOscillator.hxx.
| SoDa::QuadratureOscillator::QuadratureOscillator | ( | ) |
Constructor.
| void SoDa::QuadratureOscillator::setPhaseIncr | ( | double | _pi | ) |
set the phase increment per step for the oscillator (1/freq)
| _pi | the phase increment |
| std::complex< double > SoDa::QuadratureOscillator::stepOscCD | ( | ) |
step the oscillator and produce a complex double result
Note the use of sincos if we're building for linux. This is a bit faster than separate sin and cos calls.
The original scheme also did some near-angle approximation stuff but it really didn't help that much with computation time, as the oscillators account for such a small part of the total run time.
(notes from March, 2018) Well, no, the oscillators account for about 30% of the run time when the compiler optimizations are turned on. Changing from sincos to a complex multiply based scheme eliminates the NCO from the list of "expensive" functions.
The code still retains the choice, if it is necessary for some reason to use the sincos scheme, but by default, the NCO will be based on a complex multiply.
| std::complex< double > SoDa::QuadratureOscillator::stepOscCD_complex | ( | ) |
| std::complex< double > SoDa::QuadratureOscillator::stepOscCD_sincos | ( | ) |
| std::complex< float > SoDa::QuadratureOscillator::stepOscCF | ( | ) |
step the oscillator and produce a complex float result
This is a wrapper for stepOscCD
| double SoDa::QuadratureOscillator::stepOscD | ( | ) |
step the oscillator and produce a real double result
This is a wrapper for stepOscCD
|
private |
Definition at line 97 of file QuadratureOscillator.hxx.
|
private |
Definition at line 98 of file QuadratureOscillator.hxx.
|
private |
Definition at line 99 of file QuadratureOscillator.hxx.
|
private |
Definition at line 98 of file QuadratureOscillator.hxx.
|
private |
Definition at line 96 of file QuadratureOscillator.hxx.