0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 11:33:54 +01:00

changes here and there

This commit is contained in:
2025-06-21 14:05:56 +02:00
parent 9bfff3fef2
commit aa6f87c0da
6 changed files with 46 additions and 154 deletions

View File

@@ -5,11 +5,7 @@ void init_preemphasis(ResistorCapacitor *filter, float tau, float sample_rate, f
filter->alpha = tau / (tau + dt);
float omega = M_2PI * ref_freq / sample_rate;
float cos_omega = cosf(omega);
float numerator = sqrtf(1.0f + filter->alpha * filter->alpha - 2.0f * filter->alpha * cos_omega);
filter->gain = 1.0f / numerator;
filter->gain = 1.0f / sqrtf(1.0f + filter->alpha * filter->alpha - 2.0f * filter->alpha * cosf(omega));
filter->prev_sample = 0.0f;
}

View File

@@ -15,7 +15,7 @@ void initAGC(AGC* agc, int sampleRate, float targetLevel, float minGain, float m
agc->currentLevel = 0.0f;
agc->rms_buffer = 0.0f;
agc->rmsAlpha = expf(-1.0f / (sampleRate * 0.04f));
agc->rmsAlpha = expf(-1.0f / (sampleRate * 0.02f));
}
float process_agc(AGC* agc, float sidechain) {