Changeset b01bd4a for src/temporal/biquad.h
- Timestamp:
- Oct 19, 2009, 2:45:13 PM (15 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- b849106
- Parents:
- 59c046d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/temporal/biquad.h
r59c046d rb01bd4a 27 27 This file implements a normalised biquad filter (second order IIR): 28 28 29 \f$ y[n] = b_ 1 x[n] + b_2 x[n-1] + b_3 x[n-2] - a_2 y[n-1] - a_3y[n-2] \f$29 \f$ y[n] = b_0 x[n] + b_1 x[n-1] + b_2 x[n-2] - a_1 y[n-1] - a_2 y[n-2] \f$ 30 30 31 31 The filtfilt version runs the filter twice, forward and backward, to 32 32 compensate the phase shifting of the forward operation. 33 34 See also <a href="http://en.wikipedia.org/wiki/Digital_biquad_filter">Digital 35 biquad filter</a> on wikipedia. 33 36 34 37 */ … … 38 41 #endif 39 42 40 /** biquad filter object */ 41 typedef struct _aubio_biquad_t aubio_biquad_t; 43 /** set coefficients of a biquad filter 42 44 43 /** filter input vector 44 45 \param b biquad object as returned by new_aubio_biquad 46 \param in input vector to filter 45 \param b0 forward filter coefficient 46 \param b1 forward filter coefficient 47 \param b2 forward filter coefficient 48 \param a1 feedback filter coefficient 49 \param a2 feedback filter coefficient 47 50 48 51 */ 49 void aubio_biquad_do(aubio_biquad_t * b, fvec_t * in); 50 /** filter input vector forward and backward 52 uint_t 53 aubio_filter_set_biquad (aubio_filter_t * f, lsmp_t b0, lsmp_t b1, lsmp_t b2, 54 lsmp_t a1, lsmp_t a2); 51 55 52 \param b biquad object as returned by new_aubio_biquad 53 \param in input vector to filter 54 \param tmp memory space to use for computation 56 /** create new biquad filter 57 58 \param b0 forward filter coefficient 59 \param b1 forward filter coefficient 60 \param b2 forward filter coefficient 61 \param a1 feedback filter coefficient 62 \param a2 feedback filter coefficient 55 63 56 64 */ 57 void aubio_biquad_do_filtfilt(aubio_biquad_t * b, fvec_t * in, fvec_t * tmp); 58 /** create new biquad filter 59 60 \param b1 forward filter coefficient 61 \param b2 forward filter coefficient 62 \param b3 forward filter coefficient 63 \param a2 feedback filter coefficient 64 \param a3 feedback filter coefficient 65 66 */ 67 aubio_biquad_t * new_aubio_biquad(lsmp_t b1, lsmp_t b2, lsmp_t b3, lsmp_t a2, lsmp_t a3); 68 69 /** delete biquad filter 70 71 \param b biquad object to delete 72 73 */ 74 void del_aubio_biquad(aubio_biquad_t * b); 65 aubio_filter_t * 66 new_aubio_filter_biquad (lsmp_t b0, lsmp_t b1, lsmp_t b2, lsmp_t a1, lsmp_t a2, 67 uint_t channels); 75 68 76 69 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.