libsdr  0.1.0
A simple SDR library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
sdr::FreqShiftBase< Scalar > Class Template Reference

A performant implementation of a frequency-shift operation on integer signals. More...

#include <freqshift.hh>

Inheritance diagram for sdr::FreqShiftBase< Scalar >:
sdr::BaseBand< Scalar > sdr::IQBaseBand< Scalar >

Public Types

typedef std::complex< Scalar > CScalar
 The complex input signal. More...
 
typedef Traits< Scalar >::SScalar SScalar
 The compute (super) scalar of the input type. More...
 
typedef std::complex< SScalarCSScalar
 The complex compute (super) scalar of the input type. More...
 

Public Member Functions

 FreqShiftBase (double F, double Fs)
 Constructor. More...
 
virtual ~FreqShiftBase ()
 Destructor. More...
 
double sampleRate () const
 Returns the sample rate. More...
 
virtual void setSampleRate (double Fs)
 Sets the sample rate and updates the LUT. More...
 
double frequencyShift () const
 Returns the frequency shift. More...
 
virtual void setFrequencyShift (double F)
 Sets the frequency shift and updates the LUT. More...
 
CSScalar applyFrequencyShift (CSScalar value)
 Performs the frequency shift on a single sample. More...
 

Protected Member Functions

void _update_lut_incr ()
 Updates the multiplier LUT. More...
 

Protected Attributes

double _freq_shift
 The current frequency shift. More...
 
double _Fs
 The current sample rate. More...
 
size_t _lut_inc
 The LUT increment. More...
 
size_t _lut_count
 The LUT index counter. More...
 
Buffer< CSScalar_lut
 The LUT. More...
 

Static Protected Attributes

static const size_t _lut_size = 128
 The size of the LUT. More...
 

Detailed Description

template<class Scalar>
class sdr::FreqShiftBase< Scalar >

A performant implementation of a frequency-shift operation on integer signals.

Member Typedef Documentation

template<class Scalar>
typedef std::complex<Scalar> sdr::FreqShiftBase< Scalar >::CScalar

The complex input signal.

template<class Scalar>
typedef std::complex<SScalar> sdr::FreqShiftBase< Scalar >::CSScalar

The complex compute (super) scalar of the input type.

template<class Scalar>
typedef Traits<Scalar>::SScalar sdr::FreqShiftBase< Scalar >::SScalar

The compute (super) scalar of the input type.

Constructor & Destructor Documentation

template<class Scalar>
sdr::FreqShiftBase< Scalar >::FreqShiftBase ( double  F,
double  Fs 
)
inline

Constructor.

template<class Scalar>
virtual sdr::FreqShiftBase< Scalar >::~FreqShiftBase ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class Scalar>
void sdr::FreqShiftBase< Scalar >::_update_lut_incr ( )
inlineprotected

Updates the multiplier LUT.

template<class Scalar>
CSScalar sdr::FreqShiftBase< Scalar >::applyFrequencyShift ( CSScalar  value)
inline

Performs the frequency shift on a single sample.

template<class Scalar>
double sdr::FreqShiftBase< Scalar >::frequencyShift ( ) const
inline

Returns the frequency shift.

template<class Scalar>
double sdr::FreqShiftBase< Scalar >::sampleRate ( ) const
inline

Returns the sample rate.

template<class Scalar>
virtual void sdr::FreqShiftBase< Scalar >::setFrequencyShift ( double  F)
inlinevirtual

Sets the frequency shift and updates the LUT.

template<class Scalar>
virtual void sdr::FreqShiftBase< Scalar >::setSampleRate ( double  Fs)
inlinevirtual

Sets the sample rate and updates the LUT.

Reimplemented in sdr::BaseBand< Scalar >.

Member Data Documentation

template<class Scalar>
double sdr::FreqShiftBase< Scalar >::_freq_shift
protected

The current frequency shift.

template<class Scalar>
double sdr::FreqShiftBase< Scalar >::_Fs
protected

The current sample rate.

template<class Scalar>
Buffer<CSScalar> sdr::FreqShiftBase< Scalar >::_lut
protected

The LUT.

template<class Scalar>
size_t sdr::FreqShiftBase< Scalar >::_lut_count
protected

The LUT index counter.

template<class Scalar>
size_t sdr::FreqShiftBase< Scalar >::_lut_inc
protected

The LUT increment.

template<class Scalar>
const size_t sdr::FreqShiftBase< Scalar >::_lut_size = 128
staticprotected

The size of the LUT.


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