HARDT - The Ham Radio DSP Toolkit
hgoertzeloutput.h
1 #ifndef __HGOERTZELOUTPUT_H
2 #define __HGOERTZELOUTPUT_H
3 
9 {
11  int Magnitude;
12 
14  int Phase;
15 };
16 
25 template <class T>
26 class HGoertzelOutput : public HOutput<T, HGoertzelResult>
27 {
28  private:
29 
30  int _size;
31  int _average;
32  float _bin;
33  HWindow<T>* _window;
34  T* _buffer;
35 
36  int _count;
37  HGoertzelResult _result;
38 
39  float omega;
40  float sine;
41  float cosine;
42  float coeff;
43  float rad2degr;
44 
45  std::complex<float> _tempResult;
46 
47  void Init();
48 
49  public:
50 
52  HGoertzelOutput(int size, int average, float bin, HWriter<HGoertzelResult>* writer, HWindow<T>* window);
53 
55  HGoertzelOutput(int size, int average, float bin, HWriterConsumer<T>* consumer, HWindow<T>* window);
56 
58  HGoertzelOutput(int size, int average, H_SAMPLE_RATE rate, int frequency, HWriter<HGoertzelResult>* writer, HWindow<T>* window);
59 
61  HGoertzelOutput(int size, int average, H_SAMPLE_RATE rate, int frequency, HWriterConsumer<T>* consumer, HWindow<T>* window);
62 
65  {
66  delete _buffer;
67  }
68 
70  int Output(T* src, size_t size);
71 
73  bool Command(HCommand* command) {
74  // No ruther propagation of commands
75  return true;
76  }
77 };
78 
79 #endif
HWindow
Definition: hwindow.h:8
HGoertzelOutput
Definition: hgoertzeloutput.h:26
HGoertzelResult::Magnitude
int Magnitude
Definition: hgoertzeloutput.h:11
HWriter< HGoertzelResult >
HOutput
Definition: houtput.h:27
HGoertzelOutput::~HGoertzelOutput
~HGoertzelOutput()
Definition: hgoertzeloutput.h:64
HGoertzelOutput::HGoertzelOutput
HGoertzelOutput(int size, int average, float bin, HWriter< HGoertzelResult > *writer, HWindow< T > *window)
Definition: hgoertzeloutput.cpp:14
HCommand
Definition: hcommand.h:81
HGoertzelOutput::Command
bool Command(HCommand *command)
Definition: hgoertzeloutput.h:73
HGoertzelResult
Definition: hgoertzeloutput.h:8
HGoertzelResult::Phase
int Phase
Definition: hgoertzeloutput.h:14
HGoertzelOutput::Output
int Output(T *src, size_t size)
Definition: hgoertzeloutput.cpp:91
HWriterConsumer
Definition: hwriterconsumer.h:8