mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-09 18:45:22 +02:00
Compare commits
2 Commits
0.2.2_alph
...
0.2.3_aplh
Author | SHA1 | Date | |
---|---|---|---|
f5d6e609d7 | |||
ed49ad6f7f |
@ -148,9 +148,6 @@ namespace dsp {
|
|||||||
if (running) {
|
if (running) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (blockSize < 1 ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_blockSize = blockSize;
|
_blockSize = blockSize;
|
||||||
output.setMaxLatency(blockSize * 2);
|
output.setMaxLatency(blockSize * 2);
|
||||||
}
|
}
|
||||||
@ -159,9 +156,6 @@ namespace dsp {
|
|||||||
if (running) {
|
if (running) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (skip < 0 ) {
|
|
||||||
skip = 0;
|
|
||||||
}
|
|
||||||
_skip = skip;
|
_skip = skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,9 +164,20 @@ namespace dsp {
|
|||||||
private:
|
private:
|
||||||
static void _worker(BlockDecimator* _this) {
|
static void _worker(BlockDecimator* _this) {
|
||||||
complex_t* buf = new complex_t[_this->_blockSize];
|
complex_t* buf = new complex_t[_this->_blockSize];
|
||||||
|
bool delay = _this->_skip < 0;
|
||||||
|
|
||||||
|
int readCount = std::min<int>(_this->_blockSize + _this->_skip, _this->_blockSize);
|
||||||
|
int skip = std::max<int>(_this->_skip, 0);
|
||||||
|
int delaySize = (-_this->_skip) * sizeof(complex_t);
|
||||||
|
|
||||||
|
complex_t* start = &buf[std::max<int>(-_this->_skip, 0)];
|
||||||
|
complex_t* delayStart = &buf[_this->_blockSize + _this->_skip];
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int read = _this->_input->readAndSkip(buf, _this->_blockSize, _this->_skip);
|
if (delay) {
|
||||||
if (read < 0) { break; };
|
memmove(buf, delayStart, delaySize);
|
||||||
|
}
|
||||||
|
if (_this->_input->readAndSkip(start, readCount, skip) < 0) { break; };
|
||||||
if (_this->output.write(buf, _this->_blockSize) < 0) { break; };
|
if (_this->output.write(buf, _this->_blockSize) < 0) { break; };
|
||||||
}
|
}
|
||||||
delete[] buf;
|
delete[] buf;
|
||||||
|
@ -73,8 +73,8 @@ namespace dsp {
|
|||||||
_this->_phase += _this->_phasorSpeed;
|
_this->_phase += _this->_phasorSpeed;
|
||||||
outBuf[i].i = sin(_this->_phase);
|
outBuf[i].i = sin(_this->_phase);
|
||||||
outBuf[i].q = cos(_this->_phase);
|
outBuf[i].q = cos(_this->_phase);
|
||||||
|
_this->_phase = fmodf(_this->_phase, 2.0f * 3.1415926535); // TODO: Get a more efficient generator
|
||||||
}
|
}
|
||||||
_this->_phase = fmodf(_this->_phase, 2.0f * 3.1415926535);
|
|
||||||
if (_this->output.write(outBuf, _this->_blockSize) < 0) { break; };
|
if (_this->output.write(outBuf, _this->_blockSize) < 0) { break; };
|
||||||
}
|
}
|
||||||
delete[] outBuf;
|
delete[] outBuf;
|
||||||
|
@ -302,7 +302,7 @@ void drawWindow() {
|
|||||||
ImGui::Combo("##_1_", &srId, soapy.txtSampleRateList.c_str());
|
ImGui::Combo("##_1_", &srId, soapy.txtSampleRateList.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ImGui::Text("%s Samples/s", soapy.txtSampleRateList.c_str());
|
ImGui::Text("%.0f Samples/s", soapy.sampleRates[srId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -46,7 +46,8 @@ void SignalPath::setSampleRate(float sampleRate) {
|
|||||||
|
|
||||||
dcBiasRemover.setBlockSize(inputBlockSize);
|
dcBiasRemover.setBlockSize(inputBlockSize);
|
||||||
split.setBlockSize(inputBlockSize);
|
split.setBlockSize(inputBlockSize);
|
||||||
fftBlockDec.setSkip((sampleRate / fftRate) - fftSize);
|
int skip = (sampleRate / fftRate) - fftSize;
|
||||||
|
fftBlockDec.setSkip(skip);
|
||||||
mainVFO.setInputSampleRate(sampleRate, inputBlockSize);
|
mainVFO.setInputSampleRate(sampleRate, inputBlockSize);
|
||||||
|
|
||||||
// // Reset the modulator and audio systems
|
// // Reset the modulator and audio systems
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_STR "0.2.1_alpha"
|
#define VERSION_STR "0.2.2_alpha"
|
Reference in New Issue
Block a user