mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 19:23:51 +01:00
suprisingly works
This commit is contained in:
@@ -28,7 +28,7 @@ void init_stereo_encoder(StereoEncoder* st, uint8_t multiplier, Oscillator* osc,
|
|||||||
st->pilot_volume = pilot_volume;
|
st->pilot_volume = pilot_volume;
|
||||||
st->audio_volume = audio_volume;
|
st->audio_volume = audio_volume;
|
||||||
#ifdef STEREO_SSB
|
#ifdef STEREO_SSB
|
||||||
init_delay_line(&st->delay, 15); // 7*2+1
|
init_delay_line(&st->delay, STEREO_SSB*2+1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ float stereo_encode(StereoEncoder* st, uint8_t enabled, float left, float right)
|
|||||||
float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f);
|
float signalx2 = get_oscillator_sin_multiplier_ni(st->osc, st->multiplier * 2.0f);
|
||||||
|
|
||||||
#ifdef STEREO_SSB
|
#ifdef STEREO_SSB
|
||||||
float stereo = (crealf(stereo_hilbert) * signalx2cos) - (cimagf(stereo_hilbert) * signalx2);
|
float stereo = (crealf(stereo_hilbert) * signalx2cos) + (cimagf(stereo_hilbert) * signalx2);
|
||||||
return (mid*half_audio) + (signalx1*st->pilot_volume) + (stereo * half_audio);
|
return (mid*half_audio) + (signalx1*st->pilot_volume) + (stereo * half_audio);
|
||||||
#else
|
#else
|
||||||
return (mid*half_audio) + (signalx1*st->pilot_volume) + ((side*signalx2) * half_audio);
|
return (mid*half_audio) + (signalx1*st->pilot_volume) + ((side*signalx2) * half_audio);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define STEREO_SSB
|
#define STEREO_SSB 12
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "../dsp/oscillator.h"
|
#include "../dsp/oscillator.h"
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ void init_runtime(FM95_Runtime* runtime, const FM95_Config config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STEREO_SSB
|
#ifdef STEREO_SSB
|
||||||
runtime->stereo_hilbert = firhilbf_create(7, 60);
|
runtime->stereo_hilbert = firhilbf_create(STEREO_SSB, 80);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(config.preemphasis != 0) {
|
if(config.preemphasis != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user