Newer
Older
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
Waveform::WaveformParam::WaveformParam() {
this->samplingRate = 0;
this->freqResolution = 0;
}
Waveform::WaveformParam::WaveformParam(
const WaveformParam& other
) {
this->samplingRate = other.samplingRate;
this->freqResolution = other.freqResolution;
this->freqTones = other.freqTones;
this->phases = other.phases;
this->amplitudes = other.amplitudes;
}
void Waveform::WaveformParam::setFreqTone(
int centerFreq,
int freqSpacing,
int numTones
) {
int freqStart = centerFreq -
freqSpacing * int(std::floor(numTones / 2));
this->freqTones.setLinSpaced(
numTones,
freqStart,
freqStart + freqSpacing * (numTones-1)
);
}
void Waveform::WaveformParam::setFreqTone(
const Eigen::VectorXi otherTones
) {
this->freqTones = otherTones;
}
void Waveform::WaveformParam::setPhase(
const Eigen::VectorXd otherPhase
) {
this->phases = otherPhase;
}
void Waveform::WaveformParam::setAmplitude(
const Eigen::VectorXd otherAmp
) {
this->amplitudes = otherAmp;