Skip to content
Snippets Groups Projects
Commit b668cb29 authored by xiyehu2's avatar xiyehu2
Browse files

Minor bug fixes in wfm generation

parent 99c44884
No related branches found
No related tags found
No related merge requests found
...@@ -283,10 +283,10 @@ std::pair<void*, int64_t> ArrayWaveform::getStaticWaveform() { ...@@ -283,10 +283,10 @@ std::pair<void*, int64_t> ArrayWaveform::getStaticWaveform() {
+ this->wfmParam.phases.array()) + this->wfmParam.phases.array())
).array().colwise() * this->wfmParam.amplitudes.array(); ).array().colwise() * this->wfmParam.amplitudes.array();
bindBuffer(minSampleLen * 2); // bytes bindBuffer(minSampleLen * 2); // bytes
auto pData = (void*) this->pDataBuffer; auto pData = (int16_t*) this->pDataBuffer;
Eigen::Map<EigenVectorXi16> dataMap(pData, minSampleLen); Eigen::Map<EigenVectorXi16> dataMap(pData, minSampleLen);
dataMap = wfmMatrixrix.colwise().sum().cast<int16_t>(); dataMap = wfmMatrixrix.colwise().sum().cast<int16_t>();
return std::pair(pData, int64_t(minSampleLen)); return std::pair(this->pDataBuffer, int64_t(minSampleLen));
} }
std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform( std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform(
...@@ -354,10 +354,10 @@ std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform( ...@@ -354,10 +354,10 @@ std::pair<void*, int64_t> ArrayWaveform::getTrickWaveform(
} }
} }
bindBuffer(sampleLen * 2); bindBuffer(sampleLen * 2);
auto pData = (void*) this->pDataBuffer; auto pData = (int16_t*) this->pDataBuffer;
Eigen::Map<EigenVectorXi16> dataMap(pData, sampleLen); Eigen::Map<EigenVectorXi16> dataMap(pData, sampleLen);
dataMap = wfmMatrix.rowwise().sum().cast<int16_t> (); dataMap = wfmMatrix.rowwise().sum().cast<int16_t> ();
return std::pair(pData, int64_t(sampleLen)); return std::pair(this->pDataBuffer, int64_t(sampleLen));
} }
void ArrayWaveform::saveWaveform(std::string fileName) { void ArrayWaveform::saveWaveform(std::string fileName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment