#pragma once #define FILTER_TAPS 256 #include #include #include #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); float hard_clip(float sample, float threshold); float voltage_db_to_voltage(float db); float power_db_to_voltage(float db); float voltage_to_voltage_db(float linear); float voltage_to_power_db(float linear);