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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user