Basic Audio Signal Processing Library

Dependents:   unzen_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller synthesizer_f746

オーディオ信号処理用のライブラリです。

mbed-dspのフィルタ群向けに作ったクラス・ラッパーのほか、以下のクラスを用意しています。

  • ヒステリシス
  • sin/cosオシレータ
  • リミッター

クラスは全て名前空間amakusaに含まれます。

Committer:
shorie
Date:
Sat Feb 18 01:05:19 2017 +0000
Revision:
8:1fa224c83cfa
Parent:
6:ed10856c2305
Fixed mistake of visibility in the limitterlinatan.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shorie 1:0a37bce4f985 1 #ifndef _BIQUADCASCADEDF2T_H_
shorie 1:0a37bce4f985 2 #define _BIQUADCASCADEDF2T_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_df2T_f32() and the arm_biquad_cascade_df2T_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 BiQuadCascadeDF2T : 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 BiQuadCascadeDF2T(uint16_t stages, float32_t *pCoeff, uint32_t block_size);
shorie 1:0a37bce4f985 34 /**
shorie 1:0a37bce4f985 35 * Destructor
shorie 1:0a37bce4f985 36 */
shorie 1:0a37bce4f985 37 virtual ~BiQuadCascadeDF2T();
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 */
shorie 5:3d6cf4dbf458 43 virtual void run( float32_t *pSrc, float32_t *pDst);
shorie 1:0a37bce4f985 44 private:
shorie 1:0a37bce4f985 45 arm_biquad_cascade_df2T_instance_f32 state;
shorie 1:0a37bce4f985 46 };
shorie 1:0a37bce4f985 47
shorie 1:0a37bce4f985 48 }
shorie 1:0a37bce4f985 49
shorie 1:0a37bce4f985 50 #endif