18extern void setsfcframe(
double framem);
19extern void getsfcframe(
double *framem);
20extern void setsfcparam(
double cutoff,
double sidelobe,
double transition,
21 double tolerance,
long fftl);
22extern void getsfcparam(
double *cutoff,
double *sidelobe,
double *transition,
23 double *tolerance,
long *fftl);
24extern double getsfcratio(
double i_samp_freq,
double o_samp_freq,
double tolerance,
25 long *upratio,
long *downratio);
28extern spDVector xdvdownsample(
spDVector sig,
long downratio,
long offset,
long length);
30extern int resamplefile(
const char *i_filename,
int i_swap,
const char *o_filename,
int o_swap,
31 spDVector filter,
long upratio,
long downratio);
32extern int resampledfile(
const char *i_filename,
int i_swap,
const char *o_filename,
int o_swap,
33 spDVector filter,
long upratio,
long downratio);
34extern int sfconvlongfile(
const char *i_filename,
int i_swap,
double i_samp_freq,
35 const char *o_filename,
int o_swap,
double o_samp_freq);
36extern int sfconvlongdfile(
const char *i_filename,
int i_swap,
double i_samp_freq,
37 const char *o_filename,
int o_swap,
double o_samp_freq);
38extern spDVector xdvsfconvfile(
const char *i_filename,
int swap,
double i_samp_freq,
double o_samp_freq);
39extern spDVector xdvsfconvdfile(
const char *i_filename,
int swap,
double i_samp_freq,
double o_samp_freq);
40extern spDVector xdvfirresample(
long upratio,
long downratio,
double n);
42extern spDVector xdvsfconv(
spDVector isig,
double i_samp_freq,
double o_samp_freq,
double *new_o_samp_freq);
43extern int sfconvfile(
const char *i_filename,
int i_swap,
double i_samp_freq,
44 const char *o_filename,
int o_swap,
double o_samp_freq);
45extern int sfconvdfile(
const char *i_filename,
int i_swap,
double i_samp_freq,
46 const char *o_filename,
int o_swap,
double o_samp_freq);
48#define SP_RESAMPLE_VERSION_STRING "1.0.0"
49#define SP_RESAMPLE_VERSION 1
50#define SP_RESAMPLE_REVISION 0
51#define SP_RESAMPLE_UPDATE_LEVEL 0
52#define SP_RESAMPLE_VERSION_ID (SP_RESAMPLE_VERSION * 1000 + SP_RESAMPLE_REVISION)
54typedef struct _spResampleRec *spResampleRec;
56#define SP_RESAMPLE_OPTION_FILTER_TYPE_KAISER (1<<0)
57#define SP_RESAMPLE_OPTION_FILTER_TYPE_HAMMING (1<<1)
58#define SP_RESAMPLE_OPTION_FILTER_TYPE_BUTTERWORTH (1<<2)
59#define SP_RESAMPLE_OPTION_FILTER_TYPE_CHEBYSHEV (1<<3)
60#define SP_RESAMPLE_OPTION_TRUNCATE_EDGE (1<<8)
61#define SP_RESAMPLE_OPTION_INPUT_INTERLEAVED (1<<9)
62#define SP_RESAMPLE_OPTION_OUTPUT_INTERLEAVED (1<<10)
64typedef struct _spResampleConfig {
65 unsigned long version_id;
71 long max_input_buf_length;
73 unsigned long options;
81extern spBool _spResampleInitConfig(spResampleConfig *config,
unsigned long version_id);
82#define spResampleInitConfig(conf) _spResampleInitConfig(conf, SP_RESAMPLE_VERSION_ID)
84extern spResampleRec spResampleOpen(spResampleConfig *config);
85extern spBool spResampleClose(spResampleRec resample);
87extern spBool spResampleSetRatioWithFilter(spResampleRec resample,
spDVector filter,
long upratio,
long downratio,
88 long *max_output_buf_length,
long *default_delay);
89extern spBool spResampleSetRatio(spResampleRec resample,
long upratio,
long downratio,
90 long *max_output_buf_length,
long *default_delay);
91extern double spResampleCalcRatioFromFrequency(
double tolerance,
double i_samp_freq,
double o_samp_freq,
92 long *upratio,
long *downratio);
93extern double spResampleSetFrequencyWithFilter(spResampleRec resample,
spDVector filter,
double i_samp_freq,
double o_samp_freq,
94 long *max_output_buf_length,
long *default_delay);
95extern double spResampleSetFrequency(spResampleRec resample,
double i_samp_freq,
double o_samp_freq,
96 long *max_output_buf_length,
long *default_delay);
98extern long spResampleGetNextMaxInputBufferLength(spResampleRec resample,
long output_buf_length);
99extern long _spResampleProcess(spResampleRec resample,
char *input_buf,
long input_buf_length,
char *output_buf,
long *current_delay);
100#define spResampleProcess(resample, input_buf, input_buf_length, output_buf, current_delay) _spResampleProcess(resample, (char *)(input_buf), input_buf_length, (char *)(output_buf), current_delay)
102extern spBool spResampleReset(spResampleRec resample);
103extern long _spResampleFlush(spResampleRec resample,
char *output_buf);
104#define spResampleFlush(resample, output_buf) _spResampleFlush(resample, (char *)output_buf)
Vector type that contains the elements of double type.
Definition vector.h:248