2017-11-13 18:34:05 +00:00
|
|
|
#include "../libfilter/iir_filter.h"
|
|
|
|
|
2016-04-23 16:50:11 +00:00
|
|
|
typedef struct emphasis {
|
|
|
|
struct {
|
2017-08-19 10:33:45 +00:00
|
|
|
iir_filter_t lp;
|
2016-05-11 16:42:22 +00:00
|
|
|
double x_last;
|
2016-04-23 16:50:11 +00:00
|
|
|
double factor;
|
|
|
|
double amp;
|
|
|
|
} p;
|
|
|
|
struct {
|
2017-05-13 14:04:00 +00:00
|
|
|
iir_filter_t hp;
|
2016-05-11 16:42:22 +00:00
|
|
|
double y_last;
|
2017-01-28 07:02:11 +00:00
|
|
|
double factor;
|
2016-04-23 16:50:11 +00:00
|
|
|
double amp;
|
|
|
|
} d;
|
|
|
|
} emphasis_t;
|
|
|
|
|
2017-01-28 07:02:11 +00:00
|
|
|
#define CUT_OFF_EMPHASIS_DEFAULT 300.0
|
2016-10-23 06:46:05 +00:00
|
|
|
|
|
|
|
int init_emphasis(emphasis_t *state, int samplerate, double cut_off);
|
2017-01-29 06:25:12 +00:00
|
|
|
void pre_emphasis(emphasis_t *state, sample_t *samples, int num);
|
|
|
|
void de_emphasis(emphasis_t *state, sample_t *samples, int num);
|
|
|
|
void dc_filter(emphasis_t *state, sample_t *samples, int num);
|
2016-04-23 16:50:11 +00:00
|
|
|
|