mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-27 03:23:54 +01:00
it does break it but idk why
This commit is contained in:
@@ -29,7 +29,11 @@ void init_bs412(BS412Compressor* mpx, float mpx_deviation, float target_power, f
|
|||||||
}
|
}
|
||||||
|
|
||||||
float bs412_compress(BS412Compressor* mpx, float sample) {
|
float bs412_compress(BS412Compressor* mpx, float sample) {
|
||||||
mpx->average += sample * sample * mpx->mpx_deviation * mpx->mpx_deviation;
|
if(mpx->lookahead_counter >= BS412_LOOKAHEAD) mpx->lookahead_counter = 0;
|
||||||
|
float process_sample = mpx->lookahead_samples[BS412_LOOKAHEAD - 1 - mpx->lookahead_counter]; // get sample from the other end
|
||||||
|
mpx->lookahead_samples[mpx->lookahead_counter++] = sample; // write to the first end
|
||||||
|
|
||||||
|
mpx->average += process_sample * process_sample * mpx->mpx_deviation * mpx->mpx_deviation;
|
||||||
mpx->average_counter++;
|
mpx->average_counter++;
|
||||||
|
|
||||||
float avg_power = mpx->average / mpx->average_counter;
|
float avg_power = mpx->average / mpx->average_counter;
|
||||||
|
|||||||
Reference in New Issue
Block a user