0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23: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;
}