A Hopf, Skip and a Jump
frequencyshifter.h
1 #ifndef _FREQUENCYSHIFTER_H_
2 #define _FREQUENCYSHIFTER_H_
3 
4 #include <complex>
5 
6 #include "detectortypes.h"
7 
13 
14 public:
15  enum HilbertMode {
16  // Choose Hilbert method
17  fir,
18  fft
19  };
34  FrequencyShifter(const inputSample_t* inputSignal,
35  const std::size_t inputSignalSize,
36  const double sr,
37  HilbertMode mode = HilbertMode::fir);
38 
40 
47  void shift(const parameter_t fShift,
48  inputSample_t* shiftedSignal,
49  const std::size_t shiftedSignalSize);
50 
51 protected:
53  const inputSample_t* inputSignal;
55  const std::size_t inputSignalSize;
57  std::complex<inputSample_t>* analyticSignal;
59  const parameter_t sr;
60 
61 };
62 
63 #endif
const std::size_t inputSignalSize
input signal size
std::complex< inputSample_t > * analyticSignal
Complex array to store results of Hilbert transform.
Shift a signal by a given frequency.
void shift(const parameter_t fShift, inputSample_t *shiftedSignal, const std::size_t shiftedSignalSize)
Shift the input signal by the stated amount and fill shiftedSignal.
FrequencyShifter(const inputSample_t *inputSignal, const std::size_t inputSignalSize, const double sr, HilbertMode mode=HilbertMode::fir)
Construct a FrequencyShifter, which uses either an FIR or FFT.
const inputSample_t * inputSignal
input signal
const parameter_t sr
Sample rate.