2016-03-01 17:40:38 +00:00
|
|
|
#include "filter.h"
|
|
|
|
|
|
|
|
typedef struct samplerate {
|
2016-04-17 13:17:38 +00:00
|
|
|
double factor;
|
2016-03-01 17:40:38 +00:00
|
|
|
struct {
|
2017-01-05 14:53:55 +00:00
|
|
|
filter_lowpass_t lp;
|
2016-04-24 05:09:25 +00:00
|
|
|
double in_index;
|
2016-03-01 17:40:38 +00:00
|
|
|
} down;
|
|
|
|
struct {
|
2017-01-05 14:53:55 +00:00
|
|
|
filter_lowpass_t lp;
|
2016-04-24 05:09:25 +00:00
|
|
|
double in_index;
|
2016-03-01 17:40:38 +00:00
|
|
|
} up;
|
|
|
|
} samplerate_t;
|
|
|
|
|
2016-04-17 13:17:38 +00:00
|
|
|
int init_samplerate(samplerate_t *state, double samplerate);
|
2016-03-01 17:40:38 +00:00
|
|
|
int samplerate_downsample(samplerate_t *state, int16_t *input, int input_num, int16_t *output);
|
|
|
|
int samplerate_upsample(samplerate_t *state, int16_t *input, int input_num, int16_t *output);
|