Basic Audio Signal Processing Library
Dependents: unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746
オーディオ信号処理用のライブラリです。
mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。
- ヒステリシス
- sin/cosオシレータ
- リミッター
クラスは全て名前空間amakusaに含まれます。
biquadcascadedf1.h@5:3d6cf4dbf458, 2017-02-10 (annotated)
- Committer:
- shorie
- Date:
- Fri Feb 10 13:24:30 2017 +0000
- Revision:
- 5:3d6cf4dbf458
- Parent:
- 1:0a37bce4f985
- Child:
- 6:ed10856c2305
amakusa::AbstractFilter::run() ???blockSize ??????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shorie | 1:0a37bce4f985 | 1 | #ifndef _BIQUADCASCADEDF1_H_ |
shorie | 1:0a37bce4f985 | 2 | #define _BIQUADCASCADEDF1_H_ |
shorie | 1:0a37bce4f985 | 3 | |
shorie | 1:0a37bce4f985 | 4 | #include "abstractfilter.h" |
shorie | 1:0a37bce4f985 | 5 | namespace amakusa |
shorie | 1:0a37bce4f985 | 6 | { |
shorie | 1:0a37bce4f985 | 7 | /** |
shorie | 1:0a37bce4f985 | 8 | * @brief Wrapper class of the arm_biquad_cascade_df1_f32() and the arm_biquad_cascade_df1_init_f32(). |
shorie | 1:0a37bce4f985 | 9 | * @details |
shorie | 1:0a37bce4f985 | 10 | * To use this class, include amakusa.h |
shorie | 1:0a37bce4f985 | 11 | * |
shorie | 1:0a37bce4f985 | 12 | * The biquad filter is depicted as following. The pCoeff array has b0, b1, b2, a1, a2 parameter |
shorie | 1:0a37bce4f985 | 13 | * by this order. If the stage is N, N blockes of these parameers are given. The length of pCoeff |
shorie | 1:0a37bce4f985 | 14 | * is 5N. |
shorie | 1:0a37bce4f985 | 15 | * @code |
shorie | 1:0a37bce4f985 | 16 | x[n]---+-- b0 -->+---------+---y[n] |
shorie | 1:0a37bce4f985 | 17 | | ^ | |
shorie | 1:0a37bce4f985 | 18 | D | | |
shorie | 1:0a37bce4f985 | 19 | +-- b1 -->+<-- a1 --+ |
shorie | 1:0a37bce4f985 | 20 | D | | |
shorie | 1:0a37bce4f985 | 21 | +-- b2 -->+<-- a2 --+ |
shorie | 1:0a37bce4f985 | 22 | * @endcode |
shorie | 1:0a37bce4f985 | 23 | */ |
shorie | 1:0a37bce4f985 | 24 | class BiQuadCascadeDF1 : public AbstractFilter |
shorie | 1:0a37bce4f985 | 25 | { |
shorie | 1:0a37bce4f985 | 26 | public: |
shorie | 1:0a37bce4f985 | 27 | /** |
shorie | 1:0a37bce4f985 | 28 | * @brief Constructor |
shorie | 1:0a37bce4f985 | 29 | * @param[in] stages Number of the Bi-Quad stages. |
shorie | 1:0a37bce4f985 | 30 | * @param[in] pCoeff Ponter to the coefficients array. |
shorie | 1:0a37bce4f985 | 31 | * @param[in] blockSize Maximum number of the samples to be given to run() method at onece. |
shorie | 1:0a37bce4f985 | 32 | */ |
shorie | 5:3d6cf4dbf458 | 33 | BiQuadCascadeDF1(uint16_t stages, float32_t *pCoeff, uint32_t block_size); |
shorie | 1:0a37bce4f985 | 34 | /** |
shorie | 1:0a37bce4f985 | 35 | * deconstructor |
shorie | 1:0a37bce4f985 | 36 | */ |
shorie | 1:0a37bce4f985 | 37 | virtual ~BiQuadCascadeDF1(); |
shorie | 1:0a37bce4f985 | 38 | /** |
shorie | 1:0a37bce4f985 | 39 | * @brief Run the filter. |
shorie | 1:0a37bce4f985 | 40 | * @param[in] pSrc Pointer to the source buffer to be filtered. |
shorie | 1:0a37bce4f985 | 41 | * @param[out] pDst Pointer to the destination buffer to store the filtered signal. |
shorie | 1:0a37bce4f985 | 42 | * @param[in] blockSize Number of the sample to be filitered. If skipped or zero, blockSize is assmued the one passed to the constructor. |
shorie | 1:0a37bce4f985 | 43 | */ |
shorie | 5:3d6cf4dbf458 | 44 | virtual void run( float32_t *pSrc, float32_t *pDst ); |
shorie | 1:0a37bce4f985 | 45 | private: |
shorie | 1:0a37bce4f985 | 46 | arm_biquad_casd_df1_inst_f32 state; |
shorie | 1:0a37bce4f985 | 47 | }; |
shorie | 1:0a37bce4f985 | 48 | |
shorie | 1:0a37bce4f985 | 49 | } |
shorie | 1:0a37bce4f985 | 50 | |
shorie | 1:0a37bce4f985 | 51 | #endif |