blob: 96ef46eaeee0be9d1704c10a21fa8478b9e33b02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*
* DFTProcessor.h
*
* Created on: 29.04.2011
* Author: sven
*/
#ifndef DFTPROCESSOR_H_
#define DFTPROCESSOR_H_
#ifndef DFTAPP_PARAMETERS_H_
#include "DFTAppParameters.h"
#endif
#include <vector>
struct SpectralData
{
unsigned mFreq;
double mAmplitude;
double mPhase;
};
class DFTProcessor {
public:
DFTProcessor(DFTAppParameters&);
virtual ~DFTProcessor();
const std::vector<double>& getInputData() const
{
return mInputData;
}
const std::vector<double>& getRe() const
{
return mRe;
}
const std::vector<double>& getIm() const
{
return mIm;
}
const std::vector<double>& getIdft() const
{
return mIdft;
}
const std::vector<SpectralData>& getSpectrum() const
{
return mSpectrum;
}
private:
DFTAppParameters& mParams;
unsigned mNumDftSamples;
unsigned mSampleRate;
std::vector<double> mInputData;
std::vector<double> mRe;
std::vector<double> mIm;
std::vector<double> mIdft;
std::vector<SpectralData> mSpectrum;
void writeSpectrumToCSV();
void startGnuPlot();
};
#endif /* DFTPROCESSOR_H_ */
|