Rebuild DDC block when sample rate changes #1401
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
downconverter_cc::set_decim_and_samp_rate
currently skips rebuilding the DDC block if the decimation value has not changed. This leads to trouble, because it's possible for the sample rate to change while the decimation value remains the same. In this case, a newfreq_xlating_fir_filter_ccf
needs to be constructed, but that doesn't happen.To trigger the bug, open an RTL-SDR device through SoapyRTLSDR, and set the sample rate to 2400000. Clicking on a signal will not tune it, because the Frequency Xlating FIR Filter block has its sample rate set to 2048000, the default value used by the SoapyRTLSDR driver.
To fix the problem, I changed
downconverter_cc::set_decim_and_samp_rate
to always rebuild the DDC block, thereby constructing a new Frequency Xlating FIR Filter block.