![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Cutoff frequency variable LPF by IIR 6th-order Butterworth filter for ST Nucleo F401RE.
Dependencies: UIT_IIR_Filter UIT_ACM1602NI UITDSP_ADDA mbed UIT_AQM1602
Diff: main.cpp
- Revision:
- 7:34eced3597bb
- Parent:
- 6:116f72cda0f4
diff -r 116f72cda0f4 -r 34eced3597bb main.cpp --- a/main.cpp Sat Jul 25 06:41:36 2015 +0000 +++ b/main.cpp Fri Sep 11 09:52:06 2015 +0000 @@ -3,7 +3,7 @@ // A0: Signal to be filtered // A2: Value which controls cutoff frequency // -// 2015/07/25, Copyright (c) 2015 MIKAMI, Naoki +// 2015/09/11, Copyright (c) 2015 MIKAMI, Naoki //-------------------------------------------------------------- #include "ADC_Interrupt.hpp" // for ADC using interrupt @@ -25,11 +25,11 @@ #endif const int FS_ = 24000; // Sampling frequency: 24 kHz -ADC_Intr myAdc_(A0, FS_, A1, A2); +ADC_Intr myAdc_(A0, FS_, A2); DAC_MCP4921 myDac_; const int ORDER_ = 8; -IirCascade<ORDER_/2> iirLpf_; // IIR filter object +IirCascade<ORDER_> iirLpf_; // IIR filter object DigitalIn sw1_(D2, PullDown); // 0: disable filter // 1: enable filter @@ -41,7 +41,7 @@ { float xn = myAdc_.Read(); // Read from A0 - myAdc_.Select3rdChannel(); // Select A2 + myAdc_.Select2ndChannel(); // Select A2 myAdc_.SoftStart(); // ADC start for A2 input // Execute IIR filter