Output the audio signal with filtering by IIR filter in the *.wav file on the SD card using onboard CODEC. SD カードの *.wav ファイルのオーディオ信号を遮断周波数可変の IIR フィルタを通して,ボードに搭載されているCODEC で出力する.

Dependencies:   BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed FrequencyResponseDrawer F746_SAI_IO Array_Matrix

Revision:
5:3e8ca1ed31a1
Parent:
2:2478e7a8e8d5
Child:
7:2964179ff931
--- a/main.cpp	Mon Apr 25 13:01:25 2016 +0000
+++ b/main.cpp	Sun May 01 02:45:17 2016 +0000
@@ -5,7 +5,7 @@
 //      IIR フィルタ ---- 低域通過および高域通過フィルタ
 //      出力:モノラル    
 //
-//  2016/04/25, Copyright (c) 2016 MIKAMI, Naoki
+//  2016/05/01, Copyright (c) 2016 MIKAMI, Naoki
 //--------------------------------------------------------------
 
 #include "MyFunctions.hpp"
@@ -15,14 +15,15 @@
 
 int main()
 {
-    Label myLabel(80, 4, "SD Card Audio Player", Label::LEFT, Font16);
+    Label myLabel1(200, 4, "SD Card Audio Player", Label::CENTER, Font16);
+    Label myLabel2(200, 18, "---- variable LPF and HPF ----", Label::CENTER, Font12);
 
     const int FS = AUDIO_FREQUENCY_44K;         // 標本化周波数: 44.1 kHz
     SaiIO_O mySai(2048, FS);
 
     SD_WavReader sdReader(mySai.GetLength());   // SD カード読み込み用オブジェクト
     const int MAX_FILES = 7;
-    FileSelector selector(4, 28, MAX_FILES, 34, sdReader);
+    FileSelector selector(4, 26, MAX_FILES, 34, sdReader);
     if (!selector.CreateTable())
         BlinkLabel errLabel(240, 100, "SD CARD ERROR", Label::CENTER);
 
@@ -52,8 +53,8 @@
     // フィルタの設計と周波数特性描画用
     const int ORDER = 6;        // フィルタの次数
     DesignerDrawer drawerObj(
-                     45,        // グラフの左端の位置
-                     230,       // グラフの下端の位置
+                     40,        // グラフの左端の位置
+                     238,       // グラフの下端の位置
                      3,         // 1 dB 当たりのピクセル数
                      FS,        // 標本化周波数
                      ORDER,     // フィルタの次数
@@ -87,7 +88,7 @@
                 while (!menu.Touched(0))    // OPEN がタッチされるまで待つ
                     ModifyFilter(drawerObj, lpHp, onOff,
                                  hn, ck, g0, filterOn);
-                SelectFile(menu, selector, myLabel, fileName);
+                SelectFile(menu, selector, myLabel1, fileName);
             }
             else
             {
@@ -97,7 +98,7 @@
                     ModifyFilter(drawerObj, lpHp, onOff,
                                  hn, ck, g0, filterOn);
                 if (touch10 == 0)
-                    SelectFile(menu, selector, myLabel, fileName);
+                    SelectFile(menu, selector, myLabel1, fileName);
             }
 
             loopCount = SD_Open(sdReader, fileName, frameSize);
@@ -108,8 +109,8 @@
         else
             loopCount = SD_Open(sdReader, fileName, frameSize);
 
-        selector.Erase(BG_LEFT-4, 244);
-        myLabel.Draw("IIR Butterworth filter");
+        selector.Erase(0, 0, BG_LEFT-4, 288);
+        myLabel1.Draw("IIR Butterworth filter");
         drawerObj.DrawResponse();
         menu.Inactivate(0); // OPEN 無効
         menu.Activate(2);   // PAUSE 有効