0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00

i love correcting tilt, its so simple and straight-forward

This commit is contained in:
Kuba
2025-08-08 23:13:31 +02:00
committed by GitHub
parent 89cd93909a
commit 180f1fcb51
3 changed files with 25 additions and 17 deletions

View File

@@ -14,10 +14,11 @@ void init_preemphasis(ResistorCapacitor *filter, float tau, float sample_rate, f
float apply_preemphasis(ResistorCapacitor *filter, float sample);
typedef struct {
float tilt; // Tilt amount (-1.0 to +1.0 typical)
float prev_in; // Previous input sample
float prev_out; // Previous output sample
float a0, a1; // lowpass coeffs
float lp; // lowpass state
float low_gain; // gain for low frequencies
float high_gain; // gain for high frequencies
} TiltCorrectionFilter;
void tilt_init(TiltCorrectionFilter* filter, float alpha);
float tilt(TiltCorrectionFilter *filter, float input);
void tilt_init(TiltCorrectionFilter* f, float correction_strength, float sr);
float tilt(TiltCorrectionFilter *f, float in);