FIR filter using DSP instructions for ST Nucleo F401RE.

Dependencies:   UITDSP_ADDA mbed

Files at this revision

API Documentation at this revision

Comitter:
MikamiUitOpen
Date:
Mon Nov 16 02:24:22 2015 +0000
Parent:
7:388f3f8c16f6
Commit message:
9

Changed in this revision

UITDSP_ADDA.lib Show annotated file Show diff for this revision Revisions of this file
UIT_ADDA.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 388f3f8c16f6 -r d226de4c3951 UITDSP_ADDA.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UITDSP_ADDA.lib	Mon Nov 16 02:24:22 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/MikamiUitOpen/code/UITDSP_ADDA/#14cdca8b48f8
diff -r 388f3f8c16f6 -r d226de4c3951 UIT_ADDA.lib
--- a/UIT_ADDA.lib	Sat Nov 15 06:09:37 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/MikamiUitOpen/code/UIT_ADDA/#c326d04aa6b8
diff -r 388f3f8c16f6 -r d226de4c3951 main.cpp
--- a/main.cpp	Sat Nov 15 06:09:37 2014 +0000
+++ b/main.cpp	Mon Nov 16 02:24:22 2015 +0000
@@ -2,21 +2,19 @@
 // FIR フィルタ,基本的な構造, 固定小数点演算用 DSP 命令を使う
 //      Analog Input : A0
 //      Analog Output: MCP4922 using SPI
-// 2014/11/12, Copyright (c) 2014 MIKAMI, Naoki
+// 2015/11/16, Copyright (c) 2015 MIKAMI, Naoki
 //--------------------------------------------------------------
 
-#include "mbed.h"
-
-#include "ADC_Base.hpp"         // for ADC not using interrupt
-#include "DAC_MCP4922.hpp"      // for DAC MCP4922
+#include "ADC_BuiltIn.hpp"      // for ADC not using interrupt
+#include "DAC_MCP4921.hpp"      // for DAC MCP4921, MCP4922
 #include "Coefficients_200_LPF_Fixed.hpp"
 
 using namespace Mikami;
 
-const int FS_ = 12000;  // Sampling frequency: 12 kHz
+const int FS_ = 12000;          // Sampling frequency: 12 kHz
 const uint16_t OFFSET = 2047;   // Correspond to "0"
-ADC_Base adc_(A0, FS_); // for AD
-DAC_MCP4922 myDac_;     // for DA
+ADC_BuiltIn adc_(A0, FS_);      // for AD
+DAC_MCP4921 myDac_;             // for DA
 
 int main()
 {
@@ -42,7 +40,7 @@
             xn[k] = xn[k-1];        // move input signals
 
         // rounding and devide by 32768 + DC offset
-        uint16_t yOut = ((yn + 0x8000) >> 15) + OFFSET;
+        uint16_t yOut = ((yn + 0x4000) >> 15) + OFFSET;
         //-----------------------------------------------
         myDac_.Write(yOut);         // Write to DAC
     }
diff -r 388f3f8c16f6 -r d226de4c3951 mbed.bld
--- a/mbed.bld	Sat Nov 15 06:09:37 2014 +0000
+++ b/mbed.bld	Mon Nov 16 02:24:22 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file