Demo program of digital signal processing: Variable LPF/HPF, Vocal canceller, Pitch shifter, Reverbrator. ディジタル信号処理のデモプログラム. 遮断周波数可変 LPF/HPF,ボーカルキャンセラ,ピッチシフタ,残響生成器.
Dependencies: Array_Matrix F446_AD_DA UIT_AQM1602 mbed
SignalProcessing/SignalProcessing.hpp@3:e223a1b4e8c2, 2017-01-30 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Mon Jan 30 08:18:25 2017 +0000
- Revision:
- 3:e223a1b4e8c2
3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 3:e223a1b4e8c2 | 1 | //-------------------------------------------------------------- |
MikamiUitOpen | 3:e223a1b4e8c2 | 2 | // 信号処理の抽象基底クラスおよびその派生クラスの中で簡単なクラス |
MikamiUitOpen | 3:e223a1b4e8c2 | 3 | // |
MikamiUitOpen | 3:e223a1b4e8c2 | 4 | // 2017/01/30, Copyright (c) 2017 MIKAMI, Naoki |
MikamiUitOpen | 3:e223a1b4e8c2 | 5 | //-------------------------------------------------------------- |
MikamiUitOpen | 3:e223a1b4e8c2 | 6 | |
MikamiUitOpen | 3:e223a1b4e8c2 | 7 | #ifndef SIGNAL_PROSECCING_BASE_CLASS_HPP |
MikamiUitOpen | 3:e223a1b4e8c2 | 8 | #define SIGNAL_PROSECCING_BASE_CLASS_HPP |
MikamiUitOpen | 3:e223a1b4e8c2 | 9 | |
MikamiUitOpen | 3:e223a1b4e8c2 | 10 | // 信号処理の抽象基底クラス |
MikamiUitOpen | 3:e223a1b4e8c2 | 11 | class SignalProcessing |
MikamiUitOpen | 3:e223a1b4e8c2 | 12 | { |
MikamiUitOpen | 3:e223a1b4e8c2 | 13 | public: |
MikamiUitOpen | 3:e223a1b4e8c2 | 14 | virtual float Execute(float xn1, float xn2) = 0; |
MikamiUitOpen | 3:e223a1b4e8c2 | 15 | }; |
MikamiUitOpen | 3:e223a1b4e8c2 | 16 | |
MikamiUitOpen | 3:e223a1b4e8c2 | 17 | //--------------------------------------- |
MikamiUitOpen | 3:e223a1b4e8c2 | 18 | // 以下は派生クラス |
MikamiUitOpen | 3:e223a1b4e8c2 | 19 | //--------------------------------------- |
MikamiUitOpen | 3:e223a1b4e8c2 | 20 | |
MikamiUitOpen | 3:e223a1b4e8c2 | 21 | // 入力をそのまま出力する |
MikamiUitOpen | 3:e223a1b4e8c2 | 22 | class Through : public SignalProcessing |
MikamiUitOpen | 3:e223a1b4e8c2 | 23 | { |
MikamiUitOpen | 3:e223a1b4e8c2 | 24 | public: |
MikamiUitOpen | 3:e223a1b4e8c2 | 25 | virtual float Execute(float xn1, float xn2) |
MikamiUitOpen | 3:e223a1b4e8c2 | 26 | { return (xn1 + xn2)*0.5f; } |
MikamiUitOpen | 3:e223a1b4e8c2 | 27 | }; |
MikamiUitOpen | 3:e223a1b4e8c2 | 28 | |
MikamiUitOpen | 3:e223a1b4e8c2 | 29 | // ボーカルキャンセラ |
MikamiUitOpen | 3:e223a1b4e8c2 | 30 | class VocalCanceller : public SignalProcessing |
MikamiUitOpen | 3:e223a1b4e8c2 | 31 | { |
MikamiUitOpen | 3:e223a1b4e8c2 | 32 | public: |
MikamiUitOpen | 3:e223a1b4e8c2 | 33 | virtual float Execute(float xn1, float xn2) |
MikamiUitOpen | 3:e223a1b4e8c2 | 34 | { return xn1 - xn2; } |
MikamiUitOpen | 3:e223a1b4e8c2 | 35 | }; |
MikamiUitOpen | 3:e223a1b4e8c2 | 36 | #endif // SIGNAL_PROSECCING_BASE_CLASS_HPP |