i hate this with a passion

This commit is contained in:
2025-01-31 19:27:22 +01:00
parent 2283f5c0ca
commit a2217ecb5e
3 changed files with 17 additions and 50 deletions
+9 -4
View File
@@ -5,16 +5,21 @@
#include <stdlib.h>
#include "constants.h"
typedef struct
{
float alpha;
float prev_sample;
} ResistorCapacitor;
void init_preemphasis(ResistorCapacitor *filter, float tau, float sample_rate);
float apply_preemphasis(ResistorCapacitor *filter, float sample);
typedef struct {
float b0, b1, b2;
float a1, a2;
float x1, x2;
float y1, y2;
} BiquadFilter;
void init_preemphasis(BiquadFilter *filter, float tau, float sample_rate);
float apply_preemphasis(BiquadFilter *filter, float input);
void init_lpf(BiquadFilter* filter, float cutoffFreq, float qFactor, float sampleRate);
void init_hpf(BiquadFilter* filter, float cutoffFreq, float qFactor, float sampleRate);
float apply_frequency_filter(BiquadFilter* filter, float input);