mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-10 18:43:28 -05:00
Fix audio glitches in the DAB plugin.
The glitches were generated by an int16 integer overflow. The issue appeared when the audio was near or at the saturation level. When the input audio signal is saturated, the polyphase filter based interpolation/decimation functions tend to increase the samples values and then make them pass the int16 limits. The int16 sample scale() parameter defeat the min/max limitation. This fix removes the intermediate int16 type conversion by using the Complex Real type. fixes f4exb/sdrangel#1978
This commit is contained in:
parent
78b73ae529
commit
2fddaff6d2
@ -366,7 +366,7 @@ void DABDemodSink::tii(int tii)
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t scale(int16_t sample, float factor)
|
||||
static int16_t scale(Real sample, float factor)
|
||||
{
|
||||
int32_t prod = (int32_t)(((int32_t)sample) * factor);
|
||||
prod = std::min(prod, 32767);
|
||||
|
Loading…
Reference in New Issue
Block a user