mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 19:23:51 +01:00
17 lines
347 B
C
17 lines
347 B
C
#pragma once
|
|
|
|
#include <math.h>
|
|
#include "../lib/optimization.h"
|
|
|
|
typedef struct
|
|
{
|
|
float alpha;
|
|
float prev_sample;
|
|
float gain;
|
|
} 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);
|