mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-02-02 21:04:45 +01:00
Fixed FM bug
This commit is contained in:
parent
f760aba7dd
commit
5aa9359236
@ -145,11 +145,8 @@ namespace dsp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setDeviation(float deviation) {
|
void setDeviation(float deviation) {
|
||||||
std::lock_guard<std::mutex> lck(generic_block<FMDemod>::ctrlMtx);
|
|
||||||
generic_block<FMDemod>::tempStop();
|
|
||||||
_deviation = deviation;
|
_deviation = deviation;
|
||||||
phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation);
|
phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation);
|
||||||
generic_block<FMDemod>::tempStart();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float getDeviation() {
|
float getDeviation() {
|
||||||
|
@ -41,10 +41,12 @@ namespace dsp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateWindow(dsp::filter_window::generic_window* window) {
|
void updateWindow(dsp::filter_window::generic_window* window) {
|
||||||
|
std::lock_guard<std::mutex> lck(generic_block<FIR<T>>::ctrlMtx);
|
||||||
_window = window;
|
_window = window;
|
||||||
volk_free(taps);
|
volk_free(taps);
|
||||||
tapCount = window->getTapCount();
|
tapCount = window->getTapCount();
|
||||||
taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment());
|
taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment());
|
||||||
|
bufStart = &buffer[tapCount];
|
||||||
window->createTaps(taps, tapCount);
|
window->createTaps(taps, tapCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +54,8 @@ namespace dsp {
|
|||||||
int count = _in->read();
|
int count = _in->read();
|
||||||
if (count < 0) { return -1; }
|
if (count < 0) { return -1; }
|
||||||
|
|
||||||
|
generic_block<FIR<T>>::ctrlMtx.lock();
|
||||||
|
|
||||||
memcpy(bufStart, _in->readBuf, count * sizeof(T));
|
memcpy(bufStart, _in->readBuf, count * sizeof(T));
|
||||||
_in->flush();
|
_in->flush();
|
||||||
|
|
||||||
@ -70,6 +74,8 @@ namespace dsp {
|
|||||||
|
|
||||||
memmove(buffer, &buffer[count], tapCount * sizeof(T));
|
memmove(buffer, &buffer[count], tapCount * sizeof(T));
|
||||||
|
|
||||||
|
generic_block<FIR<T>>::ctrlMtx.unlock();
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user