remove polar stereo

fix
This commit is contained in:
2025-08-05 13:22:14 +02:00
parent 12e54f44e2
commit 6b46716860
4 changed files with 10 additions and 16 deletions
+4 -9
View File
@@ -1,10 +1,9 @@
#include "stereo_encoder.h"
// Multiplier is the multiplier to get to 19 khz, or 31.25 if polar
void init_stereo_encoder(StereoEncoder* st, uint8_t multiplier, Oscillator* osc, uint8_t polar, float mono_volume, float pilot_volume, float stereo_volume) {
// Multiplier is the multiplier to get to 19 khz
void init_stereo_encoder(StereoEncoder* st, uint8_t multiplier, Oscillator* osc, float mono_volume, float pilot_volume, float stereo_volume) {
st->multiplier = multiplier;
st->osc = osc;
st->polar = polar;
st->mono_volume = mono_volume;
st->pilot_volume = pilot_volume;
st->stereo_volume = stereo_volume;
@@ -17,11 +16,7 @@ float stereo_encode(StereoEncoder* st, uint8_t enabled, float left, float right)
float side = (left-right) * 0.5f;
float signalx1 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier);
float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f);
if(!st->polar) {
float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f);
return (mid*st->mono_volume) + (signalx1*st->pilot_volume) + ((side*signalx2) * st->stereo_volume);
} else {
return (mid*st->mono_volume) + (((side+0.2f)*signalx1) * st->stereo_volume); // Polar stereo does not contain a pilot, but it contains a -14 db carrier wave on the stereo subcarrier
}
return (mid*st->mono_volume) + (signalx1*st->pilot_volume) + ((side*signalx2) * st->stereo_volume);
}