SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Private Attributes | List of all members
SoDa::QuadratureOscillator Class Reference

sin/cos oscillator to drive TX signal chain More...

#include <QuadratureOscillator.hxx>

Public Member Functions

 QuadratureOscillator ()
 Constructor. More...
 
std::complex< double > stepOscCD ()
 step the oscillator and produce a complex double result More...
 
std::complex< float > stepOscCF ()
 step the oscillator and produce a complex float result More...
 
double stepOscD ()
 step the oscillator and produce a real double result More...
 
void setPhaseIncr (double _pi)
 set the phase increment per step for the oscillator (1/freq) More...
 

Private Attributes

double phase_incr
 
double ang
 
int idx
 

Detailed Description

sin/cos oscillator to drive TX signal chain

Definition at line 39 of file QuadratureOscillator.hxx.

Constructor & Destructor Documentation

◆ QuadratureOscillator()

SoDa::QuadratureOscillator::QuadratureOscillator ( )
inline

Constructor.

Definition at line 44 of file QuadratureOscillator.hxx.

References ang, idx, and setPhaseIncr().

Member Function Documentation

◆ setPhaseIncr()

void SoDa::QuadratureOscillator::setPhaseIncr ( double  _pi)
inline

set the phase increment per step for the oscillator (1/freq)

Parameters
_pithe phase increment

Definition at line 107 of file QuadratureOscillator.hxx.

References phase_incr.

Referenced by QuadratureOscillator(), SoDa::USRPRX::set3rdLOFreq(), and SoDa::USRPTX::setCWFreq().

◆ stepOscCD()

std::complex<double> SoDa::QuadratureOscillator::stepOscCD ( )
inline

step the oscillator and produce a complex double result

Returns
cos(ang), -sin(ang)

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.

Definition at line 63 of file QuadratureOscillator.hxx.

References ang, idx, and phase_incr.

Referenced by stepOscCF(), and stepOscD().

◆ stepOscCF()

std::complex<float> SoDa::QuadratureOscillator::stepOscCF ( )
inline

step the oscillator and produce a complex float result

Returns
cos(ang), -sin(ang)

This is a wrapper for stepOscCD

Definition at line 86 of file QuadratureOscillator.hxx.

References stepOscCD().

Referenced by SoDa::USRPTX::doCW(), and SoDa::USRPRX::doMixer().

◆ stepOscD()

double SoDa::QuadratureOscillator::stepOscD ( )
inline

step the oscillator and produce a real double result

Returns
cos(ang)

This is a wrapper for stepOscCD

Definition at line 98 of file QuadratureOscillator.hxx.

References stepOscCD().

Member Data Documentation

◆ ang

double SoDa::QuadratureOscillator::ang
private

Definition at line 113 of file QuadratureOscillator.hxx.

Referenced by QuadratureOscillator(), and stepOscCD().

◆ idx

int SoDa::QuadratureOscillator::idx
private

Definition at line 114 of file QuadratureOscillator.hxx.

Referenced by QuadratureOscillator(), and stepOscCD().

◆ phase_incr

double SoDa::QuadratureOscillator::phase_incr
private

Definition at line 112 of file QuadratureOscillator.hxx.

Referenced by setPhaseIncr(), and stepOscCD().


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