Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: F746_GUI Array_Matrix TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG SDFileSystem_Warning_Fixed FrequencyResponseDrawer F746_SAI_IO
Diff: main.cpp
- Revision:
- 11:769d986c10fa
- Parent:
- 9:fe097e4c9024
- Child:
- 12:fde5056cec5c
--- a/main.cpp Wed Jun 15 13:16:49 2016 +0000
+++ b/main.cpp Mon Jul 04 05:59:44 2016 +0000
@@ -3,9 +3,9 @@
// SD のファイル: *.wav
// PCM,16 ビットステレオ,標本化周波数 44.1 kHz
// IIR フィルタ ---- 低域通過および高域通過フィルタ
-// 出力:モノラル
+// 出力:モノラル(L+R,左チャンネルのみ,右チャンネルには出力しない)
//
-// 2016/05/10, Copyright (c) 2016 MIKAMI, Naoki
+// 2016/07/04, Copyright (c) 2016 MIKAMI, Naoki
//--------------------------------------------------------------
#include "MyFunctions.hpp"
@@ -15,15 +15,15 @@
int main()
{
- Label myLabel1(200, 4, "SD Card Audio Player", Label::CENTER, Font16);
- Label myLabel2(200, 18, "---- variable LPF and HPF ----", Label::CENTER, Font12);
+ Label myLabel1(200, 4, "Variable LPF and HPF 15:02", Label::CENTER, Font16);
+ Label myLabel2(200, 20, "---- Source: microSD card ----", Label::CENTER, Font12);
const int FS = AUDIO_FREQUENCY_44K; // 標本化周波数: 44.1 kHz
SaiIO mySai(SaiIO::OUTPUT, 2048, FS);
SD_WavReader sdReader(mySai.GetLength()); // SD カード読み込み用オブジェクト
const int MAX_FILES = 7;
- FileSelector selector(4, 26, MAX_FILES, 34, sdReader);
+ FileSelector selector(4, 22, MAX_FILES, 34, sdReader);
if (!selector.CreateTable())
BlinkLabel errLabel(240, 100, "SD CARD ERROR", Label::CENTER);
@@ -71,7 +71,6 @@
for (int k=0; k<ORDER/2; k++) hn[k] = Biquad(ck[k]);
int32_t frameSize = mySai.GetLength();
- int16_t *sn = new int16_t[frameSize+1]; // フレームバッファ
bool playOk = false;
bool filterOn = false;
bool whileFirst = true;
@@ -109,8 +108,8 @@
else
loopCount = SD_Open(sdReader, fileName, frameSize);
- selector.Erase(0, 0, BG_LEFT-4, 288);
- myLabel1.Draw("IIR Butterworth filter");
+ selector.Erase(0, 0, BG_LEFT-4, 272);
+ myLabel1.Draw();
drawerObj.DrawResponse();
menu.Inactivate(0); // OPEN 無効
menu.Activate(2); // PAUSE 有効
@@ -156,7 +155,7 @@
ModifyFilter(drawerObj, lpHp, onOff, hn, ck, g0, filterOn);
// 1フレーム分の信号処理 (IIR フィルタ) の実行
- IIR_Filtering(sdReader, mySai, sn, g0, hn, ORDER, filterOn);
+ IIR_Filtering(sdReader, mySai, g0, hn, ORDER, filterOn);
}
mySai.StopOut();
menu.Activate(0); // OPEN 有効
@@ -166,4 +165,3 @@
sdReader.Close(); // SD のファイルのクローズ
}
}
-