不韋 呂 / Mbed 2 deprecated DSP_AD_DA_Multirate

Dependencies:   mbed DSP_MultirateLinearphase

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 //----------------------------------------------------------------------
00002 //  AD 変換の結果をそのまま DA 変換する,DA 出力はアップサンプリング使用
00003 //
00004 //  2021/12/13, Copyright (c) 2021 MIKAMI, Naoki
00005 //----------------------------------------------------------------------
00006 
00007 #include "MultirateLiPh.hpp"
00008 #pragma diag_suppress 870   // マルチバイト文字使用の警告抑制のため
00009 using namespace Mikami;
00010 
00011 const float FS_ = 10.0f;        // 入力の標本化周波数: 10 kHz
00012 MultirateLiPh myAdDa_(FS_);     // 出力標本化周波数を4倍にするオブジェクト
00013 
00014 // ADC 変換終了割込みに対する割込みサービス・ルーチン
00015 void AdcIsr()
00016 {
00017     float xn = myAdDa_.Input(); // 入力
00018     myAdDa_.Output(xn);         // 出力
00019 }
00020 
00021 int main()
00022 {
00023     printf("\r\nAD 変換の結果をそのまま DA 変換します\r\n");
00024     printf("DA 変換の際はアップサンプリングを行います\r\n");
00025 
00026     myAdDa_.Start(&AdcIsr);     // 標本化を開始する
00027     while (true) {}
00028 }