0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00

add functional lpf, remake hilbert

This commit is contained in:
2025-01-26 19:26:20 +01:00
parent d2663bdb9f
commit 16fa3f3702
7 changed files with 144 additions and 66 deletions

View File

@@ -1,5 +1,5 @@
#pragma once
#define FILTER_TAPS 256
#include <math.h>
#include <string.h>
#include <stdlib.h>
@@ -14,6 +14,15 @@ void init_rc(ResistorCapacitor *pe, float alpha);
void init_rc_tau(ResistorCapacitor *pe, float tau, float sample_rate);
float apply_pre_emphasis(ResistorCapacitor *pe, float sample);
typedef struct {
float coeffs[FILTER_TAPS];
float delay[FILTER_TAPS];
int index;
} FrequencyFilter;
void init_lpf(FrequencyFilter* filter, float cutoffFreq, float sampleRate);
float apply_freqeuncy_filter(FrequencyFilter* filter, float input);
typedef struct {
float *buffer;
int write_idx; // Write position