2 * \defgroup libbfin32 32bit algorithm collection of Blackfin DSP
6 * \defgroup 32bit filter algorithm implementation
15 * \brief Basic FIR filter implementation
25 * \brief FIR filter structure.
29 int taps; ///< tap number of FIR filter. This have to be integer multiple of following parameter ratio, in case of decimator.
30 fract32 * coeff; ///< pointer to the coefficient array.
31 fract32 * delayline; ///< pointer to the internal delay line
32 fract32 * head; ///< pointer to the current write head in the delayline.
33 int ratio; ///< Interpolation / decimation ratio. effective only for the decimator and interpolator. Set to 1 for FIR filter.
34 int tapsByRatio; ///< taps / ratio pre-calcuration.
38 * \brief FIR initialization routine.
39 * \param filter TFIR32 struct. Filled by a set of parameter for fr32_fir etc, when returned.
40 * \param taps Number of taps for filter. Must be longer than 1. Must be integer multiple of ratio, for interpolator and decimator.
41 * \param coeff Coefficient array. The length have to be same or longer than taps.
42 * \param delayline Internal delay line array. The length have to be same or longer than taps. Will be zero filled by this function.
43 * \param ratio Interpolation / Decimation ratio. Must be 1 for the FIR filter.
45 * Set the structure "filter", for the filter processing. This initializer is shared among
46 * FIR filter, interpolator and decimator.
47 * This routine have to be called once before invoking fr32_fir(), fr32_interpolator(), fr32_decimator() function.
50 void fr32_fir_init( TFIR32 *filter, int taps, fract32 * coeff, fract32 * delayline, int ratio);
54 * \brief FIR processing routing
55 * \param filter TFIR32 struct. Have to be initialized by fr32_fir_init().
56 * \param in input samples buffer
57 * \param out output sample buffer.
58 * \param count number of input and output samples.
60 * Finite Impulse Response filter. The variable given to filter parameter have to be initialized by fr32_fir_init() function,
61 * at least and once before invoking this funciton.
64 void fr32_fir(TFIR32 *filter, fract32 in[], fract32 out[], int count );
67 * \brief Interpolator routing
68 * \param filter TFIR32 struct. Have to be initialized by fr32_fir_init().
69 * \param in input samples buffer
70 * \param out output sample buffer.
71 * \param count number of input samples. The number of output data in out array will be count * ratio.
73 * Interpolator. The variable given to filter parameter have to be initialized by fr32_fir_init() function,
74 * at least and once before invoking this function.
75 * The number of output samples are count * ratio. Where, ratio is defined by fr32_fir_init() function.
78 void fr32_interpolator(TFIR32 *filter, fract32 in[], fract32 out[], int count );
81 * \brief Decimator routing
82 * \param filter TFIR32 struct. Have to be initialized by fr32_fir_init().
83 * \param in input samples buffer
84 * \param out output sample buffer.
85 * \param count number of input samples. The number of output data in out array will be count / ratio. Where ratio is specified by fr32_fir_init().
87 * Decimator. The variable given to filter parameter have to be initialized by fr32_fir_init() function, at least and once before invoking this funciton.
88 * The number of output samples are count / ratio. Where, ratio is defined by fr32_fir_init() function.
91 void fr32_decimator(TFIR32 *filter, fract32 in[], fract32 out[], int count );
94 #endif /* FR32_FIR_H_ */