SAM modes have DC offset from AM carrier [fixed in v1.559]
SAM, SAL, SAU, SAS and QAM modes need DC blocking (highpass filtering) added to remove the DC offset from the demodulated AM carrier.
The DC offset produced by the carrier reduces the dynamic range available on the audio output, and it can cause other problems.
DC blocking is very simple, and can be added as a 1-pole highpass filter.
The required code for a single audio channel would look something like this:
//In = new input sample
//Out = new output sample
//Inp = previous input sample
//Outp = previous output sample
//0.995 = R factor
Out = In - Inp + (0.995 * Outp); //compute new output sample
Inp = In; //save the input sample for next computation
Outp = Out; //save the output sample for next computation
This highpass filter needs to be added to the audio path for each (stereo) output audio channel when in the SAM modes. It should probably be placed in the SAM_demod.cpp file.
Since there are two audio outputs, this means the filter needs to be added in a way that makes it independent for the Left and Right channels.
One way to do this is to write two versions, with each of the memory variables marked as Left and Right.
Another way might be to write it as a function - as long as the compiler generates separate memory variables for each instance (for Left and Right).
It is unknown how this will interact with the FADE_LEVELER in the SAM_demod.cpp code.
The example code was from here: