Fixed FM bug

This commit is contained in:
Ryzerth 2021-04-18 00:13:32 +02:00
parent f760aba7dd
commit 5aa9359236
2 changed files with 6 additions and 3 deletions

View File

@ -145,11 +145,8 @@ namespace dsp {
}
void setDeviation(float deviation) {
std::lock_guard<std::mutex> lck(generic_block<FMDemod>::ctrlMtx);
generic_block<FMDemod>::tempStop();
_deviation = deviation;
phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation);
generic_block<FMDemod>::tempStart();
}
float getDeviation() {

View File

@ -41,10 +41,12 @@ namespace dsp {
}
void updateWindow(dsp::filter_window::generic_window* window) {
std::lock_guard<std::mutex> lck(generic_block<FIR<T>>::ctrlMtx);
_window = window;
volk_free(taps);
tapCount = window->getTapCount();
taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment());
bufStart = &buffer[tapCount];
window->createTaps(taps, tapCount);
}
@ -52,6 +54,8 @@ namespace dsp {
int count = _in->read();
if (count < 0) { return -1; }
generic_block<FIR<T>>::ctrlMtx.lock();
memcpy(bufStart, _in->readBuf, count * sizeof(T));
_in->flush();
@ -70,6 +74,8 @@ namespace dsp {
memmove(buffer, &buffer[count], tapCount * sizeof(T));
generic_block<FIR<T>>::ctrlMtx.unlock();
return count;
}