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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user