1 #ifndef __SDR_FREQSHIFT_HH__
2 #define __SDR_FREQSHIFT_HH__
7 #include "operators.hh"
13 template <
class Scalar>
34 std::exp(std::complex<double>(0,-(2*M_PI*i)/_lut_size));
109 #endif // FREQSHIFT_HH
double frequencyShift() const
Returns the frequency shift.
Definition: freqshift.hh:51
Buffer< CSScalar > _lut
The LUT.
Definition: freqshift.hh:99
virtual void setSampleRate(double Fs)
Sets the sample rate and updates the LUT.
Definition: freqshift.hh:46
Definition: autocast.hh:8
virtual void setFrequencyShift(double F)
Sets the frequency shift and updates the LUT.
Definition: freqshift.hh:53
size_t _lut_inc
The LUT increment.
Definition: freqshift.hh:95
virtual ~FreqShiftBase()
Destructor.
Definition: freqshift.hh:39
double sampleRate() const
Returns the sample rate.
Definition: freqshift.hh:44
std::complex< SScalar > CSScalar
The complex compute (super) scalar of the input type.
Definition: freqshift.hh:22
FreqShiftBase(double F, double Fs)
Constructor.
Definition: freqshift.hh:26
std::complex< Scalar > CScalar
The complex input signal.
Definition: freqshift.hh:18
Traits< Scalar >::SScalar SScalar
The compute (super) scalar of the input type.
Definition: freqshift.hh:20
A performant implementation of a frequency-shift operation on integer signals.
Definition: freqshift.hh:14
void _update_lut_incr()
Updates the multiplier LUT.
Definition: freqshift.hh:78
CSScalar applyFrequencyShift(CSScalar value)
Performs the frequency shift on a single sample.
Definition: freqshift.hh:58
void unref()
Dereferences the buffer.
Definition: buffer.cc:63
Forward declaration of type tratis template.
Definition: traits.hh:20
size_t _lut_count
The LUT index counter.
Definition: freqshift.hh:97
double _freq_shift
The current frequency shift.
Definition: freqshift.hh:91
static const size_t _lut_size
The size of the LUT.
Definition: freqshift.hh:103
double _Fs
The current sample rate.
Definition: freqshift.hh:93