M5StickCを簡易オシロスコープにする その1 事前調査(ADC)

概要

導通チェッカーと、20ミリ秒間隔(50Hz)サンプリングでの簡易テスターを作成してみました。今回はもう少し早いサンプリングレートでの簡易オシロスコープに調整してみたいと思います。

基準信号作成(AD9833)

手元にあったDDS信号発生器モジュールを使って、基準となる信号を発生させたいと思います。このモジュールは中国から買えば200円以下と非常に安いモジュールになっています。

接続はSPIなのでちょっと面倒ですが、M5StickCでも利用が可能です。

制御用M5StickCAD9833簡易オシロM5StickC
3.3VVCC
GNDDGND
26SDATA
0SCLK
GNDFSYNC
AGNDGND
OUT36

結線は上記にしました。制御用のM5StickCからAD9833を制御して、出力を別のM5StickCで取り込んでみます。DGNDとAGNDがありますが、デジタル用とアナログ用なので別になっています。FSYNCはSSとかCSと呼ばれるセレクト用の信号なので、GNDに接続して常に選択されている状態にしています。

スケッチ

#include <SPI.h>
#include <MD_AD9833.h>

// Pins for SPI comm with the AD9833 IC
#define DATA  26	///< SPI Data pin number
#define CLK    0	///< SPI Clock pin number
#define FSYNC -1	///< SPI Load pin number (FSYNC in AD9833 usage)

//MD_AD9833	AD(FSYNC); // Hardware SPI
MD_AD9833	AD(DATA, CLK, FSYNC); // Arbitrary SPI pins

// Character constants for commands
const char CMD_HELP = '?';
const char BLANK = ' ';
const char PACKET_START = ':';
const char PACKET_END = ';';
const char CMD_FREQ = 'F';
const char CMD_PHASE = 'P';
const char CMD_OUTPUT = 'O';
const char OPT_FREQ = 'F';
const char OPT_PHASE = 'P';
const char OPT_SIGNAL = 'S';
const char OPT_1 = '1';
const char OPT_2 = '2';
const char OPT_MODULATE = 'M';
const uint8_t PACKET_SIZE = 20;

void setup()
{
  Serial.begin(115200);
  AD.begin();
  usage();
}

void usage(void)
{
  Serial.print(F("\n\n[MD_AD9833_Tester]"));
  Serial.print(F("\n?\thelp - this message"));
  Serial.print(F("\n\n:<cmd><opt> <param>;"));
  Serial.print(F("\n:f1n;\tset frequency 1 to n Hz"));
  Serial.print(F("\n:f2n;\tset frequency 2 to n Hz"));
  Serial.print(F("\n:fmn;\tset frequency modulation to n Hz"));
  Serial.print(F("\n:p1n;\tset phase 1 to n in tenths of a degree (1201 is 120.1 deg)"));
  Serial.print(F("\n:p2n;\tset phase 2 to n in tenths of a degree (1201 is 120.1 deg)"));
  Serial.print(F("\n:ofn;\toutput frequency n or modulation [n=1/2/m]"));
  Serial.print(F("\n:opn;\toutput phase n or modulation [n=1/2/m]"));
  Serial.print(F("\n:osn;\toutput signal type n [n=(o)ff/(s)ine/(t)riangle/s(q)uare]\n"));
}

uint8_t htoi(char c)
{
  c = toupper(c);

  if (c >= '0' && c <= '9')
    return (c - '0');
  else if (c >= 'A' && c <= 'F')
    return (c - 'A' + 10);
  else
    return (0);
}

char nextChar(void)
// Read the next character from the serial input stream
// Blocking wait
{
  while (!Serial.available())
    ; /* do nothing */
  return (toupper(Serial.read()));
}

char *readPacket(void)
// read a packet and return the
{
  static enum { S_IDLE, S_READ_CMD, S_READ_MOD, S_READ_PKT } state = S_IDLE;
  static char cBuf[PACKET_SIZE + 1];
  static char *cp;
  char c;

  switch (state)
  {
    case S_IDLE:   // waiting for packet start
      c = nextChar();
      if (c == CMD_HELP)
      {
        usage();
        break;
      }
      if (c == PACKET_START)
      {
        cp = cBuf;
        state = S_READ_CMD;
      }
      break;

    case S_READ_CMD:   // waiting for command char
      c = nextChar();
      if (c == CMD_FREQ || c == CMD_PHASE || c == CMD_OUTPUT)
      {
        *cp++ = c;
        state = S_READ_MOD;
      }
      else
        state = S_IDLE;
      break;

    case S_READ_MOD: // Waiting for command modifier
      c = nextChar();
      if (c == OPT_FREQ || c == OPT_PHASE || c == OPT_SIGNAL ||
          c == OPT_1 || c == OPT_2 || c == OPT_MODULATE)
      {
        *cp++ = c;
        state = S_READ_PKT;
      }
      else
        state = S_IDLE;
      break;

    case S_READ_PKT: // Reading parameter until packet end
      c = nextChar();
      if (c == PACKET_END)
      {
        *cp = '\0';
        state = S_IDLE;
        return (cBuf);
      }
      *cp++ = c;
      break;

    default:
      state = S_IDLE;
      break;
  }

  return (NULL);
}

void processPacket(char *cp)
// Assume we have a correctly formed packet from the pasing in readPacket()
{
  uint32_t  ul;
  MD_AD9833::channel_t chan;
  MD_AD9833::mode_t mode;

  switch (*cp++)
  {
    case CMD_FREQ:
      switch (*cp++)
      {
        case OPT_1: chan = MD_AD9833::CHAN_0; break;
        case OPT_2: chan = MD_AD9833::CHAN_1; break;
        case OPT_MODULATE: /* do something in future */ break;
      }

      ul = strtoul(cp, NULL, 10);
      AD.setFrequency(chan, ul);
      Serial.printf("setFrequency(%d, %d)\n", chan, ul);
      break;

    case CMD_PHASE:
      switch (*cp++)
      {
        case OPT_1: chan = MD_AD9833::CHAN_0; break;
        case OPT_2: chan = MD_AD9833::CHAN_1; break;
      }

      ul = strtoul(cp, NULL, 10);
      AD.setPhase(chan, (uint16_t)ul);
      Serial.printf("setPhase(%d, %d)\n", chan, (uint16_t)ul);
      break;

    case CMD_OUTPUT:
      switch (*cp++)
      {
        case OPT_FREQ:
          switch (*cp)
          {
            case OPT_1: chan = MD_AD9833::CHAN_0; break;
            case OPT_2: chan = MD_AD9833::CHAN_1; break;
            case OPT_MODULATE: /* do something in future */ break;
          }
          AD.setActiveFrequency(chan);
          Serial.printf("setActiveFrequency(%d)\n", chan);
          break;

        case OPT_PHASE:
          switch (*cp)
          {
            case OPT_1: chan = MD_AD9833::CHAN_0; break;
            case OPT_2: chan = MD_AD9833::CHAN_1; break;
            case OPT_MODULATE: /* do something in future */ break;
          }
          AD.setActivePhase(chan);
          Serial.printf("setActivePhase(%d)\n", chan);
          break;

        case OPT_SIGNAL:
          switch (*cp)
          {
            case 'O': mode = MD_AD9833::MODE_OFF;    break;
            case 'S': mode = MD_AD9833::MODE_SINE;   break;
            case 'T': mode = MD_AD9833::MODE_TRIANGLE;  break;
            case 'Q': mode = MD_AD9833::MODE_SQUARE1;  break;
          }
          AD.setMode(mode);
          Serial.printf("setMode(%d)\n", mode);
          break;
      }
      break;
  }

  return;
}


void loop()
{
  char  *cp;

  if ((cp = readPacket()) != NULL)
    processPacket(cp);
}

ライブラリマネージャーにあるMD_AD9833というライブラリを使わせていただきました。スケッチ例にあるMD_AD9833_Testがシリアルモニタから周波数などを設定できるので便利でした。出力をちょっとだけ修正していますが、基本機能はスケッチ例のままになります。

[MD_AD9833_Tester]
?	help - this message

:<cmd><opt> <param>;
:f1n;	set frequency 1 to n Hz
:f2n;	set frequency 2 to n Hz
:fmn;	set frequency modulation to n Hz
:p1n;	set phase 1 to n in tenths of a degree (1201 is 120.1 deg)
:p2n;	set phase 2 to n in tenths of a degree (1201 is 120.1 deg)
:ofn;	output frequency n or modulation [n=1/2/m]
:opn;	output phase n or modulation [n=1/2/m]
:osn;	output signal type n [n=(o)ff/(s)ine/(t)riangle/s(q)uare]

シリアルモニタから?を送信すると、上記のような画面になります。:f110000;で10,000Hzに設定して、:oss;でサイン波が出力されます。

上記のオシロスコープを使って、波形を確認してみます。

あれ、最初にびょーんと高い電圧が出てしますね。これはオシロスコープ側の問題な気がします。オートスケールにすると毎回波形が小さくなりすぎるので、固定スケールで使うほうが良さそうですね。

拡大したところです。オシロスコープの能力が足りていない、、、確認は100KHzぐらいで出力してみたいと思います。

サイン波の出力です。ちゃんと100KHzぐらいのグラフになっていますね。出力は0.7Vぐらいになります。

三角波です。三角は一山が1周期なんですね。

矩形波です。矩形波は0.7V出力ではなく、VCCの電圧になります。出力レベルが違うのでちょっとびっくりします。

大丈夫そうなので、値の変化がわかりやすい三角波を基準信号にしたいと思います。とりあえず10KHzぐらいの信号にしてみます。

ESP32のADC速度上限を調べる

#include <driver/i2s.h>

#define I2S_NUM                     I2S_NUM_0
#define ADC_INPUT                   ADC1_GPIO36_CHANNEL // ADC CHANNEL
#define ADC_UNIT                    ADC_UNIT_1          // ADC1 or ADC2

#define I2S_SAMPLE_RATE             16000
#define I2S_BUFFER_COUNT            4
#define I2S_BUFFER_SIZE             512

#define STORAGE_LEN                 (102400)  // 本体保存容量(MAX 100K前後)
#define BTN_GPIO                    (37)
#define REC_DELAY_MS                500

uint8_t recBuffer[I2S_BUFFER_SIZE]; // DMA転送バッファ
uint8_t recStorage[STORAGE_LEN];    // サウンドデータ保存領域

bool recFlag = false;               // 録音状態
int recPos = 0;                     // 録音の長さ

void i2sInit() {
  i2s_config_t i2s_config = {
    .mode                 = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN),
    .sample_rate          = I2S_SAMPLE_RATE,
    .bits_per_sample      = I2S_BITS_PER_SAMPLE_16BIT,
    .channel_format       = I2S_CHANNEL_FMT_ALL_LEFT,
    .communication_format = I2S_COMM_FORMAT_I2S,
    .intr_alloc_flags     = ESP_INTR_FLAG_LEVEL1,
    .dma_buf_count        = I2S_BUFFER_COUNT,
    .dma_buf_len          = I2S_BUFFER_SIZE,
    .use_apll             = false,
    .tx_desc_auto_clear   = false,
    .fixed_mclk           = 0
  };

  i2s_driver_install(I2S_NUM, &i2s_config, 0, NULL);
  i2s_set_adc_mode(ADC_UNIT, ADC_INPUT);
  i2s_adc_enable(I2S_NUM);
}

// 録音用タスク
void i2sRecordTask(void* arg)
{
  // 初期化
  recPos = 0;
  memset(recStorage, 0, sizeof(recStorage));

  // 開始直後は録音しない
  delay(REC_DELAY_MS);

  // 録音処理
  while (recFlag) {
    size_t transBytes;

    // I2Sからデータ取得
    i2s_read(I2S_NUM, (char*)recBuffer, I2S_BUFFER_SIZE, &transBytes, portMAX_DELAY);

    // データ保存
    for (int i = 0 ; i < transBytes ; i += 4 ) {
      if ( recPos < STORAGE_LEN ) {
        uint16_t* val = (uint16_t*)&recBuffer[i];
        int16_t* p = (int16_t*)&recStorage[recPos];
        *p = (((0x0fff - (*val & 0x0fff)) * 16) - 0x8000);
        recPos += 2;
      }
    }

    Serial.printf("transBytes = %d, STORAGE_LEN=%d, recPos=%d\n", transBytes, STORAGE_LEN, recPos);
    delay(1);
  }

  //i2s_driver_uninstall(I2S_NUM);

  // タスク削除
  vTaskDelete(NULL);
}

void i2sRecord() {
  // 録音開始
  recFlag = true;
  xTaskCreatePinnedToCore(i2sRecordTask, "i2sRecordTask", 2048, NULL, 1, NULL, 1);
}

void setup() {
  Serial.begin(115200);
  delay(500);

  pinMode(BTN_GPIO, INPUT);
  i2sInit();
}

void loop() {
  if (recFlag == false && digitalRead(BTN_GPIO) == 0) {
    // 録音スタート
    Serial.println("Record Start");
    i2sRecord();
  } else if (recFlag == true && digitalRead(BTN_GPIO) == 1) {
    // 録音ストップ
    recFlag = false;
    delay(100); // 録音終了まで待つ

    Serial.println("Record Stop");

    // データをシリアルに出力
    for (int n = 0; n <= recPos; n++) {
      Serial.printf("%02x", recStorage[n]);
    }
    Serial.printf("\n");
    Serial.printf("Print End\n");
  }

  delay(10);
}

上記はマイク録音のときに使ったコードをベースにしています。一般的にタイマーでADC入力をする例が多いのですがちょっと面倒ですよね?

なのでI2Sを使って、サンプリングレートを変更しながら調べていきます。ボタンを押すとレコーディングがはじまりますので、1秒程度押してデータを保存します。するとシリアルコンソールにデータが出力されますので、そのデータを解析します。

Record Stop
f0a3f0a7d09cb08a00800080f087f09910a750a60098c08400800080808d20a0f0a750a2f08f70800080b081f093f0a3f0a7509d508b0080008030870098f0a620a60098608500800080008d00a0f0a700a3609250810080f081109370a3f0a7609e308c008000800087f098e0a630a67098008700800080508c009ef0a700a3f091e0810080b0827092f0a3f0a7209ec08c008000800086209870a660a67098608600800080008cb09dc0a730a3009360810080f080f08f70a2f0a700a0808d00800080b085009800a600a7f099608700800080308b009df0a7f0a3f093a08200800080f08ff0a1f0a700a0308e0080008000850098b0a900a7609ae08900800080b08ae09cf0a7f0a39095308300800080f08fd0a1f0a7c0a0b08e00800080f0835096c0a400a7009bf08700800080508a109c80a7f0a44095008300800080f08f20a1f0a7f0a0008f00800080f083c095f0a470a7009b508900800080f087009c00a7f0a4c095008300800080008f10a1f0a710a1308f0080008000833095f0a390a7609ab08900800080f087e09a20a700a5209690840080008f90a0f0a7f0a1f08f108000802083e094f0a3f0a7709c108b00800080f087709a00a7c0a41097e08400800080008e10a0f0a760a2f08fe0800080f081f093f0a380a7909d208b008000803087f09900a7a0a50098808500800080608d00a080a700a3f08f00800080a081f08fb0a3d0a7009e008c008000800087f09800a7d0a6e098b08600800080308c609eb0a900a330921081008030817092b0a2f0a7109e008c00800080c085709830a600a6e098108700800080008c009ec0a7b0a3209390810080f080f08f20a3d0a7c09ee08c008000808085a09490a5e0a6a099008700800080308b309e80a7f0a3c093a08100807080108ff0a1f0a700a0108d00800080b084009810a6d0a5509a108700800080f087309cd0a7f0a3f09300830080b081f08fd0a1f0a730a0a08e00800080e0849096f0a300a7009bf087008000808089e09c90a7f0a39095708300800080f08fb0a1f0a700a0008f00800080f083b09600a510a7009cf087008000808089209bf0a700a53095f08300800080308fc0a0f0a700a1308f0080008000831095f0a430a7009c808900800080f087009b30a760a50096f08300800080708e30a1f0a740a1f08f008000801083f094c0a470a7a09c708af0830080f087f09900a7f0a10097f08300800080208e00a0f0a7e0a1f08f008000801083f093b0a3f0a7009d108b008000809087f09900a60098008500800080208d709ef0a7e0a2f08ff0800080f0817093f0a3f0a7b09d608b0080008000876099c0a600a61098f08300800080d08c00a0f0a7e0a2b09280810080f081009380a3f0a7309e008c008000802086109970a670a61099b08600800080108c309ef0a780a30093d08100803081909200a3f0a700a0f08c00800080c085109830a6c0a61099e08700800080208cb09df0a750a3c09330820080f080f08fe0a2f0a700a0008e0080008040850098f0a400a7f099708700800080608b009df0a7f0a3a093008300800080f08f70a2f0a700a1908d00800080d084709680a5d0a4f099f08700800080408a209cb0a7f0a3f093e08300800080f08f80a1f0a700a0008f00800080f083a09500a620a7009bf08700800080f087009cd0a700a5d095c08300800080d08f50a1f0a700a1b08f00800080f083c095e0a480a7709c908900800080f087009c00a7f0a30096b08300800080c08e10a0f0a7f0a0f08f0080608b00800080f086009920a590a50098808500800080008c309ee0a770a2f08f708000800081709200a330a7309e008c008000809085309830a600a67098908600800080008c509df0a700a35092008000805081c09200a3c0a700a0c08c00800080f084009860a670a60099608700800080008c509df0a7f0a36093f0810080d080f08fd0a000a0b08d00800080f0840097d0a500a7b099c08700800080c08af09c00a710a5f093308200800080f08ff0a1f0a700a0108e00800080f083109780a500a7709af08700800080508a309c80a7f0a3f094808300800080f08f90a110a750a0008f00800080f083009600a0f08c0080008030850098d0a600a76099a08f00800080f0831095e0a490a7009cd08900800080f087609b90a750a53096f08300800080d08ef0a0f0a780a1f08f008000800083f094f0a490a7309cf08900800080f087b09a00a7a0a57096c08400800080308e00a0f0a7f0a1f08f0080008030820093f0a3a0a7d09c008b00800080f087309900a720a60098008500800080008d00a0e0a760a2f08f20830080f0810093c0a3e0a7f09c208b008000800087309910a570a59096608500800080b08c709ef0a760a2008ff080008090810093a0a3f0a7009e008c008000806086e09870a670a6e098608600800080908b409ef0a730a3c092908100808081709210a3f0a700a0c08c00800080e0855098608a509c10a7e0a47094208300800080d08f90a1f0a700a0c08e00800080f0833096f0a430a7909af08700800080c08a009c30a7e0a38095208300800080008ff0a1e0acb0a0308f00800080f083f09400a0108e00800080d084009780a500a7f099f08700800080c08af09cf0a7f0a3f094008300800080f08ff0a1f0a7e0a0308ee0810080f0837098a0a530a7209b00800080e08a009c80a790a58095908300800080c08f00a1e0a7d0a0808f00800080b083f094a0a520a7609bf08700800080f087309b00a7f0a43095808300800080b08e70a0c0a750a1c08f00800080f0831095f0a310ab009cd08900800080f087c09a00a700a53096f0830080008000802081a09200a3f0a7009e008c008000809086f09800a610a6b098108600800080908b009eb0a7a0a2709280810080f080f091d0a2f0a7709ef08c008000800086309810a630a60099308600800080308b309df0a700a3c092c08100800081f08ff0a1f0a7c09e008d00800080d0840098f0a700a7f099808700800080008b309df0a7f0a30097a08200803080f08ff0a1f0a700a0c08d00800080c084009710a640a7009bf08700800080a08ad0a0b0a7f0a3e094208300800080f08f30a1b0a770a0c08e00800080f083009600a500a7009be087008000808089e09c00a7f0a3f094d08700800080108f40a2f0a730a0708f00800080f0830096c0a3a0a7a09bf087008000803089509b30a7f0a32096f08300800080008fc0a0f0a720a1f08f008000800083b09430a3c0a7009c808900800080f083d09a10a730a50097f08300800080008e30a0f0a780a1f08f308000807082c09400a390a7609cf089008000809087f09900a750a50098908500800080008e00a0f0a7f0a1f08f0080e081c093d0a3c0a7b09c308b008000800087f099b0a600a60098108500800080708c00a0f0a760a2f08f008000802081009380a3e0a7f09c008c008000806086f09800a600a62098008600800080008c209e00a700a3509220810080f080709270a2e0a7709eb08c008000806085009830a610a6f098708600800080308b309df0a3b095c08300800080508f60a1f0a7b0a0708f00800080f0838095f0a350a7009bf08700800080f087609b00a710a58095c08300800080608e70a0f0a700a1f08f1080008050833095f0a3b0a7f09c508a00800080f087709e00a710a52097708400800080008e00a0d0a7e0a0f08f008000805082f093e0a370a7709e708a00800080d087309a00a7d0a40097b08700800080708c00a090a7f0a1f08f008000805083009390a320a7d09c008b00800080a0853099c0a6e0a50098008500800080708c00a0f0a750a2f08fc080008000817092f0a1a0a7609d608b008000800086c09870a600a66098008700800080308c009ed0a770a3f091308100803081f09100a3b0a7909e708c008000800086009810a600a7f098008700800080308b109ef0a730a39093f08100803081f08f60a280a7c09e108d00800080c085009830a5a0a6b099008700800080a08a709ec0a780a38093f08100800080f08f80a3f0a700a0108d00800080f0830097a0a5f0a7009e208700800080608f309c80a7f0a3f09300800080f08f80a1b0a730a0608e00800080f083009630a580a7009bf0870080b0812089509bd0a7c0a43095008300800080308f20a1f0a700a1308f00800080c083009600a590a7009b8089008000804089909b30a750a5c095f08300800080008fc0a0d0a710a1b08f0080008070835095e0a400a7709cf0890080808500800080b08cc09ef0a7d0a2309290810080a081209370a3f0a7109e008b008000800086c09800a600a6c098d08600800080508cb09df0a700a37092b08100801081709200a3a0a7609e308c008000800086409800a6b0a7f098008700800080008c009ec0a7a0a3009300800080f080f08ff0a1f08ff0800080b081009300a380a7809d908b008000802086709870a600a60098608600800080308d009ef0a710a3f08ff08000801081709210a3c0a7209e008d008000801086009810a670a67098608600800080908b009e90a700a30093c0810080d080f08f00a3f0a7a09e708d0080008020850098c0a570a65099308700800080008bf09c30a7f0a3f0a7d0a0808f00800080e083c095f0a310a7b09af08700800080f087009b00a7f0a38095b08300800080008f70a0f0a7a0a0108f208000800083f094f0a380a7109cf08900800080f087009b50a730a57096c08500800080208e20a0f0a770a2f08f308000801083f093f0a3c0a7a09dc08a0080e087f099f0a600a60098108500800080008e00a0f0a7409ef08f708000807082f093a0a3f0a7609c208b00800080a087f099e0a600a60098808500800080f08f00a0f0a7a0a2f08ff08000802080009300a3f0a7409d008b008000801086f098d0a6b0a52098008600800080608cb09de0a700a3009330810080a080009300a370a7e09cf08c008000800086f0a730a30093908100807080f08f60a290a7b09ef08c008000808085009880a570a61099008700800080b08a009d80a790a38093908100803081f08fc0a1f0a700a0008e00800080f0844096b0a500a7509a908700800080608af09ca0a7f0a3e094008300806080f08fc0a1f0a700a0308e00800080f083609670a4b0a6f09af087008000803089009c80a7f0a4f094a08300800080d08f90a1f0a780a1008f00800080f0838095c0a430a7109cf08700800080f087609c10a7f0a36095f08300800080c08cf0a0f0a780a1c08f008000809083009590a490a7009cb08900800080f087009b80a700a56096f08300800080908ea0a0f0a730a1f08f00800080008000801086e09830a500a61098308600800080308cb09dc0a730a34092308100801081d09200a3f0a7009e308d008000807086309820a660a61099208700800080008c009ed0a780a30093f0810080f080f08ff0a1f0a7309ea08c008000800085009830a570a6c099d0860080008bf09cf0a780a3f093f08100806080f08f70a200a600a0508d00800080d084009840a6c0a6009bf08700800080708a509cf0a7f0a3e094008300800080f08f90a1f0a760a0a08e00800080f083309600a5a0a6009bf087008000808089009c60a7d0a41095008300800080b08ff0a0a0a760a0c08e00800080d0830096f0a400a7d09ac089008000804089009c00a6f0a3c095f08300800080208fc0a1f0a7f0a0908f008000808083f094f0a3e0a7009cb08900800080f087509b60a710a5e096b08400800080908e70a0f0a720a0f08f808100800083f093f0a390a7609cf089008000800087f099e0a600a50097f08400800080c08d00a0c0a7f0a1f08f00800080a082b093b0a380a7b09c308b008000808087609b70a690a50098f08400800080f08c009ec0a730a2f08f30800080b081409290a390a7009d908b00800080f087909970a600a67098008600800080a08d609ef0a700a3f091f08000803081c09280a3f0a7709e808b008000803086209800a770a6f099508700800080008c609df0a780a37092f08100800081d09ac0a2f0a700a0b08c008000802085009800a650a76099108700800080308bf09c90a700a39093508100801080f08f50a2c0a700a0008d00800080f083009890a570a6e099008700800080308a309cd0a7f0a3a09370820080e080f08ff0a1f0a700a0608e00800080f08390a550a7009bf08700800080d089009cf0a700a5f094808300800080f08ff0a0f0a7d0a0908e00800080f0831096f0a430a7409bf08700800080308a009c10a7d0a45095208300800080d08fe0a0f0a710a1808f00800080c0837094e0a490a7009cc08900800080f087009b80a760a37096f08300800080c08e90a0f0a700a1f08f008000800083709430a390a7109cc08900800080209820a670a61099408600800080308c009ec0a700a31093a0810080d080f08f90a1f0a7709e408d00800080c085009810a670a6f099208700800080108bf09cf0a700a33093f08100808081f08fe0a1f0a700a0008d00800080f083209790a570a6f099a08700800080e08ae09cf0a7f0a3f093c08200800080f08f20a1f0a730a0008e00800080f083109630a530a7009b908700800080e089009c00a7f0a3f094808700800080f08f30a1f0a7f0a0008f0080008080831096f0a430a7409bf087008000803089309ca0a7b0a49095b08300800080708ff0a0f0a700a1908f008000808083f094f0a380a7009cf08700800080f087709c10a7f0a4c096f08300800080a08e70a0f0a7b0a1f08f0080008050837094f0a3f0a7a09cf08900800080c087f09920a7e0a71097f08400800080008e10a0f0a7f0a1f08f10810080f081f09300a5f0a7309d008b00800080c087b09900a700a60098008700800080708c00a0f0a700a3f08fd0800080f081f0a3f0a7609d008c008000801087309960a620a62098708600800080d08c709ef0a720a330924081008020810093f0a080a7909d008c008000807086709870a630a75098608600800080008c909dd0a700a3f091508100806080f08fe0a290a7709eb08c008000801086009820a570a69099308700800080008cc09c90a780a3f08ff08100800080f08f00a3a0a700a000a7009b608a00800080f087009c30a7d0a40096c08300800080208fb0a0f0a720a1a08d0080008060839095f0a430a7009c8089008000800087f09900a7c0a43096f08300800080008e409ef0a7109ef08f008000800083f093f0a350a7509c208a00800080e087f099f0a3a0a50097f08300800080008e00a0f0a730a2f08f00800080f080b093f0a360a7f09c008b008000808087909900a7c0a50097308500800080108d00a0b0a7c0a1f08f10800080f080009390a3f0a7009e308bb08000800087f098b09cd08900800080f087a09a00a700a56096e08400800080308e60a0f0a7f0a1f08f00800080b082f093e0a3f0a7f09c708a008000808087f099108cf09cf0a770a30093d08100805081f08f00a3f0a700a0708c008000800086009830a6c0a61099108700800080808b809df0a790a3809370820080d080f08f30a2c0a700a0008e008000809085009800a600a7309af08700800080d08ae0a720a57094e08200802080f08ff0a1b0a720a0008e00800080f083c09620a500a7009bf08700800080008b009c10a7f0a3f094008300800080f08f30a1f0a730a0008f00800080f0830096f0a350a7009c808900800080e089009c40a7b0a4c095e08300800080c09200a1f0a730a1c08f00800080f083809510a5b0a7009c908900800080f087009c40a730a50096f08300800080008f60a0f0a780a1f08f00800081f091c0a2d0a7309e008c00800080b085109870a630a6d098008700800080008ca09dc0a700a37092b08100802081f08fc0a2e0a7709ec08c00800080b085009860a570a69099508700800080008c009ef0a7f0a3d093908200807080f08fe0a2f0a7d09e608d008000800085b096b0a590a78099308700800080308a709c90a7f0a3e094008300802080f08fb0a1f0a730a0508e00800080f0835096f0a4c0a6709af08700800080f087009c80a7f0a3f094308300800080b08f00a0f0a770a0b08e008000809083f08ff0a350a7009b4089008000809089909bd0a7f0a31095308300800080408f70a0b0a700a1508f0080008080831095f0a4a0a7009cf08900800080f087e09aa0a760a57096f08300800080008f00a0f0a7f0a1d08f008000806082f093f0a3a0a7709c708a00800080f087009b10a730a53097f08400800080d089f0a0f0a780a5f08fa0800080c082f093e0a330a7209d008b00800080a08700a7b0a60098d08500800080108d00a0f0a7f0a1f08f708000807082d09290a3f0a7509d008b008000807086109900a700a60098008600800080008d309ef0a790a3a092f08000806081a09250a3f0a7109e608c008000800086309800a660a6c098f08400800080008cb09de0a750a30093f0810080f080c092c0a2f0a7709e508c008000809085109820a030a6e098008700800080a08b409df0a7f0a3e093708200805080f08ff0a1d0a700a0808d008000803085009790a530a7c099508700800080b08af09c80a7d0a3f093f08100801080908ce0a1f0a700a0008e00800080f0841097a0a500a7e09af08700800080f089709ce0aaf0a30095008000800080308ff0a0f0a700a0b08e00800080c0830096f0a400a7009bf08700800080f087009c40a700a69095908300800080f08ff0a0f0a730a1808f00800080b083f094f0a430a7009c808900800080b08ac09a00a780a59095e08300800080008f30a0b0a700a1f08f008000801083909410a550a7009cf08900800080f087709a00a720a5b096f08300800080908d00a0f0a7c0a1f08f00800080608200807086709890a6a0a6d098c08600800080008ca09df0a700a3b092f0810080f080f091e0a3f0a7909e308c0080008000860098f0a770a66099308700800080008b009df0a7e0a35093f0810080b080f08ff0a700a0908d00800080a0850098b0a5e0a6f099908700800080108b109df0a7f0a3d094708c0080c080f08f50a2f0a760a0e08e00800080f083209790a5d0a7009b108900800080f089709c70a6c0a40095b08300800080f08f80a1f0a7c0a0008f00800080f083f09660a500a7d09af08700800080b089009cb0a710a66095908300800080308f00a1f0a700a0308f008000809083309500a0008e0080008030851097c0a500a7b09af08700800080a083f094b0a4f0a7509cf08900800080f087609a60a790a5d096308500800080308e60a0f0a730a2f08f50800080f081f093f0a390a7309c008b008000809087c09960a6e0a60097208500800080008d00a0b0a730a2f08f00800080f081009390a3b0a7e09c008c008000800087f09870a600a66098708500800080d08c909ef0a700a3f091f0800080f0810093b0a3f0a7109e008c008000803086b09830a600a6b096c08500800080008c309df0a7f0a3709260810080c080f08fd0a2f0a700a0b08c008000800086009810a5c0a60099d08600800080108b809dd0a6b0a31096808100806080f08ff0a1f0a7909e308d00800080f084009800a560a630a780a50096808300800080008f30a1f0a7f0a0008f00800080a0830096d0a480a7409b6089008000808089009b00a7f0a46096f08300800080f08e00a0f0a720a1f08f008000800083f093a0a0008f00800080f083009600a610a7f087008000808089f09980a7f0a3f094c08300800080408ff0a0f0a7f0a0708f00800080b083b096f0a300a7409b208900800080f087309b80a7e0a41096f08300800080708ef0a0f0a750a1808f008000800083f094f0a380a7009c808900800080f087009b00a700a60097f08300800080408e00a0f0a7f0a1f08fe08200800083c094f0a350a7c09c008c00800080d087109b00a7c0a50098a08500800080008e00a0f08fc0a290a7709e708c0080008000860098f0a330a6f098b08600800080008c009ef0a7e0a3209340810080c080709230a2f0a700a0108d008000801085009830a5d0a6e099008700800080708af09cf0a7f0a3d093b08200800080f08f20a290a700a0208e00800080f0842097b0a500a7009bf08700800080f087209cc0a7f0a3f094008300800081f08f80a1f0a7d0a0008f00800080f0833096c0a400a7309bf08700800080f087009c00a7f0a31095008300800080008fe0a0f0a720a0108f00800080f0833096f0a380a7309c608b008000805089309b00a760a6d095f08400800080008f10a0f0a700a1308f00800080c082f094f0a300a7309c908900800080f087509a30a780a52096f08300800080008e00a0f0a7f0a1f08f008000800083f093f0a3f0a7009cd08a00800080f087909a00a700a70098008500800080308d00a0f0a750a200800080f081e093e0a3d0a7309d808b008000802087f09970a600a60098508500800080f08c00a0f0a700a3f09130810080e0810093f0a3c0a7409d008c008000800087009930a670a60098f08700800080108c009eb0a730a32092008000800080f08f00a3f0a7309e008c00800080c085109800a660a60099c08400800080608bd09ef0a730a33093d0810080b080f08f70a2f0a7b09df08c00800080d085009890a5b0a6f099008700800080708af09cf0b020a3808300800080608e00a0f0a7f0a0f08f008000800083c09450a5e0a7009cb08900800080f087009b00a780a50097f08400800080d08c00a0f0a750a2f08f008000807082e093f0a390a7c09c908a008000808087d099d0a6f0a47096f08400800080d08d00a0a0a990a1f08f30800080f0819093e0a3e0a7709d308b008000803087309990a600a60098008500800080008d00a0f0a700a32092008000808081d09330a3f0a7c09d108c008000801086f09870a630a57098008600800080308c709ef0a700a3009310810080f080f08f00a3e0a7009ec08c008000808085009860a530a6f098108600800080108bb09da0a700a35093f08100800080f08ff0a1e0a7009b308d008000801085009800a630a6f099808700800080008b709c80a7f0a3f093b08200803080f08ff0a1d0a700a0008e00800080c084c09670a5f0a6f099908700800080308ac09cd0a7f0a3008300800080f08ff0a1f0a7a0a0e08e00800080f0839099f0a400a7b09af087008000809089e09ab0a7f0a35095f08000800080808fb0a0f0a770a0008f0080008030839095f0a420a7009cf08700800080f087709a90a7f0a31096f08300800080808fe0a0f0a750a1f08f008000809083c094b0a430a7809bb08900800080f087c09c00a7f0a3d095f08300800080108e00a0f0a7f0a1f08f008000800083f09380a5f0a7b09ca08a00800080c087f09900a760a60097c08400800080608d00a0e0a7f0a1f08f0080008040822093b0a3e0a7709d008b00800080b0879099b0a600a60098808500800080f08c00a0f0a770a2f08fc0800080b081309380a3b0a7f09c908b00800080e084d09800a6f0a31098908700800080108cc09df0a700a370921081008030806092f0a3f0a7009ef089008000801086c09800a6d0a63099008700800080008cb09df0a710a38093f08100803080f08f70a2f0a700a0e08c00800080f084009890a530a65099308700800080308b509c30a7f0a36093d08100800080f08fd0a190a700a0808d00800080f084c09600a670a6c099a08700800080708a509c00a7e0a3f0937082d08f008000801083e094f0a390a7009cc08900800080f087d09a00a7f0a30097f08300800080b08d00a0f0a7d0a1f08f008000807082f093b0a300a7c09c00800080f087609ab0a6f0a40098008500800080408d00a0f0a750a0f08f70800080d081f093a0a3a0a7f09ce08a008000800087609970a610a50097308500800080e08c90a120a700a3f08f70800080c081309380a3f0a7b09d008c00800080c0860099d0a660a66098508600800080508c309ef0a730a3b092808100801081f08f80a3f0a700a0f08c008000801086009800a6c0a6d098708600800080708b209d30a710a3d092c0810080f080f08f70a2f0a7b09ec08c00800080f0842098f0a48093f08100800080f08f80a1f0a700a0308d00800080f083c096c0a500a7709af08700800080708a709c60a7f0a3f093008300801080f08ff0a1f0a700a0608e00800080e0842092d0a410a7009bf08700800080f089109c80a7f0a33095b08300800080b08fd0a0f0a7f0a0d08e00800080f083a095e0a490a7809bf08700800080f087009c50a7f0a4f093f08300800080208fc0a0f0a7d09da08f00800080f0835095f0a330a7209c908900800080f087009b00a7f0a32096f08300800080208f70a0f0a7d0a1f08f008000800083b09450a530a7a09c708a00800080b087e099d0a6f0a47096708400800080208d00a0f0a790a1f08f408000807082f0931086009820a6c0a6b099008700800080908bf09c60a720a3009340810080e080f08f30a2d0a5609ef08c00800080f084009800a600a7b09900800080408bf09cf0a7f0a3f093f08200807080f08fd0a1f0a7f091508d00800080b084009790a520a7709af08700800080608ab09cf0a7f0a3f093208300800080f093d0a1f0a730a0f08e00800080f083709620a510a7309bf08700800080b089109c9099008700800080308b009ef0a7f0a3f093e08200803080f08fb098f0a700a0208d00800080c084009860a560a6209af08700800080708ae09cc0a700a3f093308200803085f08f00a1f0a760a0608e00800080f084009700a700a6409af0870080008000800080008e00a0d0a7f0a0f08f00800080b082f093f0a390a7009ce08a00800080f087f099b0a580a50097f08400800080608d00a0e0a7a0a1f08f50800080f081a09330a3b0a7009de08a008000805087909900a700a60098008600800080908d00a0e0a700a3f08fb0800080b0812093d0a3f0a7309d008c008000800087f09800a600a60098008600800080708c709ef0a700a3309260800080a081509200a3a0a7a09d508c00800080b085609800a600a60099e08600800080008b709df0a7b0a31093f0810080f080f091c0a2f0a700a0208d008000809085009800a6d0a69099108700800080008c109d80a7f0a32093708200807080f08ff0a1f0a700a0b08e00800080b085009880a530a7f099908700800080408a209dc0a5f0a3f093708200807080f08f80a1f0a700a0008e00800080709630a500a7d09af08700800080f089009cf0a7e0a40095508300800080f08f50a190a710a1008f0080008090839095d0a4b0a6509b208900800080f087009bf0a6f0a49099508300800080108ff0a0f0a7d0a0c08f00800080d0833095f0a3b0a7809ba08900800080f087009b00a7f0a3a095f08300800080d08f30a0e0a710a1f08f008000800083f093f0a340a7009ce08900800080f087709a00a780a5f096008000800080a08d00a0f0a7c0a1f08f70800080f081f093f0a3c0a7909d008b00800080d087f099c0a69099908700800080808b309ce0a7f0a3f093408200804080f08f70a290a770a0a08d008000807084a09690a590a7f099e08700800080b08ab09cb0a6f0a37094708200800080f08ff0a1f0a900a0f08f008000809084d09690a550a7009bf08700800080f089109c40a700a54095a08300800080908f70a0f0a7d0a0008f00800080e083c095d0a430a7209cf087008000803089309b00a7a0a40096908300800080208f50a0f0a7f0a0308f00800080f0813095f0a4d0a7209cf08700800080f087609b50a780a57096108500800080f08e30a0f0a7e0a1f08f0080008000838095f0a3e0a700a0608a00800080a087f09900a730a60097e08400800080b08d00a0f0a7f0a1f08f80800080f0814093f0a380a7f09cc089008000800087009970a620a60098308500800080f08cb09ec0a750a2f08ff0800080109330a330a7809d808b00800080d086f09800a600ac3098b08500800080508c309ef0a700a3709290810080b081709210a3f0a7209e408c00800080b086f09850a630a50099008700800080608b209df0a700a3e092808100809080f08f30a1f0a700a0708c008000801085009890a670a6c099808700800080008c409d30a7f0a3b093e08100803080f08ff0a1a0a700a0008e008000809085009710a500a78099d08700800080b08a709c00a7e0a3f093f08100807080f08ff0a1f0a700a0008e0080f089008000809089009b30a700a65096f08300800080608e30a0f0a780a1f08f108000807082f093f0a380a7109cf08900800080c087f09970a660a57096f08300800080108e00a0f0a710a1f08f708000807082f093f0a390a7e09c708a0080008000879099a0a660a50098708500800080308d00a0e0a760a2f08fc0800080c0808093b0a3f0a7809d908b008000800087b09920b020a67098208600800080108c00a0f0a730a30093108100805081b09210a3f0a7309e708c0080008070867098c09c308b008000803087f09900a700a60098008500800080208db09ef0a770a2f08fa080008080816093a0a3f0b1909d508b008000800087f09830a700a690a7f0a38093f08100807080f08f70a2e0a7909e808d0080008000850098b0a500a7b099908700800080309c20a7d0a3f093f08100800080f08f20a1f0a730a0708e00800080f083e09610a500a6009bf08700800080e089e09c90a7f0a4b094008300800080908f30a1f0a7a0a0008f00800080f083009600a500a7809bf08700800080708a709b60a7b0a49095908100800080008f00a180a770a0008f008000808083809510a590a7609b3089008000807089009b00a700a5b096708500800080608ef0a0f0a710a1f08f008000800083f093f0a790a7009c908900800080f087709a00a730a50098c08400800080608e40a0f0a7f0a3f08f10800080f081b0a280a7a09ed08c0080008030820098b0a570a62099008700800080508b909df0a7f0a3d093308200807080f08f70a2f0a700a0008e00800080f0840097c0a500a7f099f08700800080608af09cd0a7f0a3b094008300800080f08ff0a1b0a900a0f08900800080f083b096f0a430a7009bc08900800080e089709cf0a7f0a31095608300805080d08f10a1f0a7f0a0008f0080008080831095d0a4d0a6709bf08700800080708a609b90a7c0a3c095e08300800080f08f00a010abf0a0308f0080008080839095f0a4f0a7109cf08700800080f087009bf0a700a53096f08300800080108e00a0f0a7a0a1f08f00800080f082f093e0a480a7109c008b00800080f087c09a00a700a70097e08400800080908d30a0f0a7f0a1f08f70800080a082f093f0a360a7209d008b00800080f09900a700a60097c08500800080308d00a0f0a770a2f08ff08000805082f093f0a3f0a7409d008c008000800087b09810a710a6b098108600800080a08c109ef0a790a1f08fd0800080a081009390a3f0a7109e308c008000806086a098e0a610a7f098008600800080208c909dd0a7b0a30093b08100800080f08fd0a2e0a7509df08c00800080a085009800a6c0a60099008700800080308bc09c70a780a35093a0810080c080f08fb0a1f0a700a0408d008000800085009830a540a7b099808700800080508a709c80a780a3f093708200801080f08fd0a1f0a720a0b08d008000803087f09660a5c0a6609af08700800080f089009cc0a7f0a3f093008300800080f08f80a1e0a730a0008f00800080f083a09550a530a7909b108900800080a089009cc0a790a5b095708400800080408f70a0f0a7f0a0108f0080008030831095f0a340a7009cf08700800080f087609bf0a720a56096f08300800080e08ef0a0f0a750a1f08f008000803083f093f0a3a0a7109cf08900800080f087e09a10a720a3e096f08300800080908d30a0f0a700a3f08f008000807082a094f0a3f0a7109d008c00800080f087f09900a7f0a30098508500800080308d00a0f0a770a2f08ff080008070826093b0a3009860a6b0a63099008700800080408b009d30a7c0a3009380810080308050a2d0a700a0308d008000800086009830a500a6f099908700800080708af09ce0a7f0a3b094108300800080a08f30a2f0a700a0008f00800080f083b09640a500a7709af08700800080508c609cf0a7a0a3f094008300800080c08f30a1f0a700a0f08f00800080f0830096f0a4f0a7009bf08700800080f087509b60a6f0a30095f08300800080f08fb0a0f0a700a1108f008000802083809500a530a7909b608900800080f087d09a00a710a53096f08300800080d08e50a0f0a700a1f08f008000801083f09460a0c08e00800080f0834096f0a400a6d09af08700800080c08900
Print End

上記のような出力になります。

その後、検証していたら動かなくなりました(涙)

基準信号その2(DAC出力ノコギリ波)

const int pin = 26;

void setup() {
  pinMode(pin, OUTPUT);
}

void loop() {
  for (int i = 0; i < 256; i++) {
    dacWrite(pin, i);
  }
}

こんな感じでノコギリ波を出力させました。

こんな出力になって、703Hzぐらいですね。

取得(16000)

Record Stop
a094309ef0a710b300bcf0c7c0d300e0f0e760f380fb7002f00f701ba025f02fe03b1047f05370660078d081708c709600a180ab50b6f0c090cb40d630e100ebf0f3b0fde007f00f301d10276032903d704a0058006bf07c3085008ff098f0a340ae00b770c2b0ced0d6b0e2e0ec10f5e000500af013f01fc02af0330041504d805d206bf07f0086f08ff09930a680af00bc10c5f0cfe0da30e5f0ef20f83003000d30169021f02c00371043f04f905f60700080f0871093b09de0a760b2f0bcf0c7f0cf50db00e6b0f180f9f004000fa019d023102f90395046f053f06300768081708ad09400a0f0a9f0b330be70caf0d300e0f0e900fcf007f00f601cf027f02f203cf047e056106ef079d082108d009870a200ae10b780c180cd00d7a0e1f0e790f30000f0075015f01cf027c033d03e304b8059506b507d4085f08f709af0a300aeb0b820c390cd10d9e0e330ee70f6f001900b10178027c02bc0367043604da05c106ff07f00877092d09c00a610b180bb20c6f0cf80db70e6f0f060f91003f00c0018f021a0316038f0447052905f30760080f089f09300a0f0a7f0b360bcf0c7f0cf00e0f0e7f0f110fcc005f00f001bd025f02fe039f0473056006760760081c08bc09530a100ab10b510c110cbd0d5f0e080ebf0f320fef007f00f701cd027f031c03cf0472058f067307ef089308e309880a300ae60b8c0c320cd00d780e1e0ecf0f3f003d00af013c01ef029f034d040004d605b606ef07f0087f08fc09aa0a600b0d0b9c0c300cff0d9f0e3b0ef00f8f001800f6017f021f02cc037f041304f705ef0710080f0872093409df0a7f0b1b0bcf0c7f0cf00e0f0e7f0f040f93005000ff018b023602da03a50450053f063b075f080808b009610a0f0a7d0b4b0bef0c720d900e0f0e7f0f3c0fc0007c00fc01b7026f02f603df0490057b066f0780083108c009800a010ac00b7f0c100cc20d780e3e0ebf0f40000f007f00f301ef0279033903ef049f058b06c007e1085f08f709af0a300afe0b900c370cd70d8f0e380ed90f59001300c001650215036a041004f105ef070f07f2087f08f309960abd0b000bb50c6f0cf00db90e5f0efe0f8f003300e40183021602d2038b043f04ff05fe0730080f089f093909ef0a7f0b300bff0c7f0cf00e0f0e760f2c0faf003e00ff0191025f02f303ba0470056a06520773082708c009590a000ab10b520bf10cbf0d400e050ebf0f300fdf007f00f301df0271033e03cf0475058d067607af083708e709890a360ad60b8f0c3f0ce30d810e370edf0f40000e00af013301ff0273035f040304c005d306cf07f7086f08f009b10a760ae60baf0c370ce90d9f0e3e0ee80f77002700cf018d021b02c7038c043f04fc05df0700080f087c093909cb0a7f0b160bc10c7f0cf00e030e7c0f1b0fac005f00dd018f023c02e50399045f053f0619075c080b08a609600a0f0a980b560bff0c710d3c0e0f0e7d0f300fc8007f00fe01b0027f02f303df04700580067607b6082f08cb09670a200ac00b7a0c190cb00d6f0e1f0ecf0f30000f007d013e01ff0290033303e104bf059f069c07e3086d08ea09af0a400aff0b9f0c3a0cef0d9f0e3e0ed10f6f001500dd015f020002ce035c042f04fc05e006f0080f0877092c09a30a6b0b1c0bac0c6f0cff0d970e6f0ef30f9f003700e3017f023e02df0384043f04fa05f00730080308ac093909e90a980b3d0bef0c7d0d600e0f0e960f3d0fa3005f00ff0193025f02f303b104710560066b082e08c0096f0a100ac90b550bf70cb70d600e010ec00f30000f007f00f101df0279033103e304af059f067107bf083a08e0098e0a160ae10b8c0c240cd20d870e280edd0f5d000600c3013201ff029f033a040104d005b006ef07f7086f08f309a80a3f0b000bb30c500cff0d9f0e370ee00f8f001700c5017e021002cf0383043f04f605ff0710080f087f08ff09cf0a7d0aef0bc00c7f0cf00e030e780f100fbf003300ff019f024302ef0380046f04f006300780080708a609500a000ab00b620bff0c9f0d300e0f0e790f390fb0007f00fa01bf027f02f003c80493056f0676073c083908d109820a130ac70b6f0c000cc90d5e0e030ec20f500fef007b013701ef027f033503e804980593069007e3085908f1099f0a450ae00b9f0c330cf70d840e5a0ee10f71000300b3015f01f702a5035f041a04f205ed06ef07ff087f08f709c90a780b1b0ba90c5f0cff0d960e580f1e0f8f002e00e70180023402f703830457052006300730080f087e093309e80a790b300bdf0c730d300e0e0e7b0f330fb0006f00f3019f024002ff0390047f053f0630078c081008ca09600a100abb0b6d0c090cb10d5b0e0f0e9f0f300fef007f00fd01df027f031303ff0497058f067e07ef083308d0098f0a310ad00b770c2f0cc10d730e300eef0f3d000f0096015f01fc02a0033003f204d905b006bf07f3086f08f009c80a500bb80c5f0cf60d780e5b0ee70f69001200c0017f020c02bc0367042f04f305ef0700080f087009300a060a610b100bcb0c6f0cf00e0f0e7e0f1b0f9f003000f4019c023d02e603a904500537062f0730080008bf09300a050aaf0b3a0be60ca90d530dbf0e9f0f370fc3005f00f901b3026902f703cf047f0540067b079f081308d009860a270ac10b7f0c0b0ca00d700e010ebf0f30000f007f013e01df027f0340040004b8059006ca07ef083008e909980a3a0adf0b8f0c380cd10d900e360ee00f72001500b1017f01ff029f034f041004e005c1070f07fd086f091609c00a570b010bc10c6f0cff0d990e500ef10f8f001600d30170023002ed038f044f04ff05fb0740080b0892093009ef0a780b3d0bef0c7f0cf00e0f0e770f2f0fc0006f00f001b3026f02f2039b047e053f0630078e081a08a009700a100ab10b700c1c0c950d6f0e030ebf0f3b0fcf007f00f001cd027f031d03c504a0058f067807b9085108e6099f0a340ac00b860c2f0cc20d780e3d0ecd0f59001400af013601fc02a30353040d04df059c06c707e0087008f709a70a500b0f0b910c5f0cfe0d970e6b0efb0f7a003a00b30161021b02b00370043f04f905f00700080f0871093609df0a7f0b1f0bc00c6f0cf00dbe0e630f1f0f9f003000f90198023f034e039b045f053f06300760080308a809500a0e0a9f0b3f0bef0c7f0d300e0e0f400fcf007f00f701cc02af02fe03bf04770562065107c3082508d0098f0a1f0ac00b8f0c1f0cc00d770e100ebd0f30000f007f013501ef0277033003f304b305b006c507f8085f08f0099f0a3b0ad10b920c380cd20d9f0e300eeb0f6b000e00b0017f020002c1037803d104e805d006ef07f7086f08f309c70a610b100bc70c690d300e070e6f0f000f87003300df017a022002e303bf043f04f1061b0731080d089e09300a0f0a700b310bcd0c9f0cf00e0f0e7e0f270fae005f00ff019d025f02f303b304a9056b063f074e081308ca09510a170aa60b5f0bf60cba0dbe0e130eba0f200fef007f00f301cb027f031203df0470059f067807bf083d08e5098d0a3c0ad30b880c330cb00d8c0e110ecf0f410000007f014e01ef02910356040f04c005c706ef07f4085f08f5098f0a450b090b9f0c3e0cff0d9f0e330ef00f8e002b00c3019b021e02a70367042f04fb05d70700080f0870093009da0ad10b360bc00c7f0cf00e0f0e3f0efd0f9f003e00ed019f023602ef03960463053f064e073b080908bc09500a0b0a980b300bff0c7f0d300e0f0e7d0f3b0fc2007f00f001c1027f02f103df0477056f060e0787082b08c0098e0a170ac00b7b0c1b0cb90d7b0e160ed90f580fdf007f00f501df02700330040004cd0599069007e8085308f709af0a330af50b840c380cde0d8f0e350eec0f6f001000c5015202b7036f043004f005ec06cf07f9087f08f309b70a680af00bb30c6f0cf00db10e7f0f080f9f003500e5017f021f0297038f043f04fb06170720080f087f093309e60a990b3f0c1f0c7f0cf00e0a0e700f360fac005d00fe01af024f02f0039f0478055006660781083508bb09500a070aa60b520bf60ca90d500e0f0e7b0f320fdf007f00f201cf0279031403df0493056f067107b3080308e709800a350ae70bef0c200ce00d800e390ebf0f310fcf007f013501ff0295037c03d704c005b306cf07f4086f08f209b60a500afe0b900bf90cff0d9f0e310ee70f8f002200f10175021f02c0037f043f04f005e706e00c7f087e091f09ce0a7f0b1d0bc00c7f0cf00e030e7f0f170fa0003000eb0180023002ff038c0433053a061f0731081008bf09360a0f0a990b460bdf0c7f0d300e0f0e7f0f340fb8005000f901b10265031003cf047005ce066b0786081508d0099b0a100ac00b6f0bf00ccc0d630d900ecf0f30000f007f013901ba027c032003eb04af058f063107ee084208f309900a570aee0b8f0c300cf70d8f0e1d0eda0f57000f0093016f01cf029c035f041004e105d306ff07fe087f08f309b00a6f0a700bbb0c580cf00dba0e5f0eff0f92003500dc0182023902d0033f043f04f105f00730080f087c093b09ef0a750b3b0bdb0caf0d300e0f0e750f110f90005700f90193025702ec03a9047705400780080008c0097f0a0f0a9e0b3f0bff0c9f0d300e0b0e7f0f3b0fc0007f00fc021b0278031e03d604a20561067b0729083308d009800a360aa00b7e0c2f0cc00d700e310edf0efe000700af013301ef027f034003f304c005b006cf07fa086f08f909ca0a500b0a0bbf0c300cf30d9f0e330eee0f39001f00c60168021002c5037c043f04fb05e8071f07f5087f091709c80a7f0b010bc60c7f0cf90dbf0e730f1e0f9e004300f60197022d02e3039204000537062b0744080008b009570a0f0a9f0b320bff0c9f0d400e0f0e7b0f300f8d005f00fe01b5025f031a03bf0437056b0673079e083608d0098f0a000acc0b6f0bfe0cd10d300e100ecc0f320fef0098017001ef027f033003ef0493058b069307df083f08f1099f0a3d0ae80b9f0c770ce50d9d0e370ee60f50000700af014d01ff02930352047904dd05c006ef07f0087709200a0b0a630af20bb60c550cc00db80e5b0efb0f80003100da0170023702d0038c044f04f105fc06f0080f087809300a3f0a770b200bef0c7f0cf00e0d0e790f220fb1006000f1019f023002ff03930472055f0635078c081508be09380a110ab10b6f0bff0c9f0d300e0f0e9f0f3f0fcf007f00b701cf0275031103ef049c0587065b07f0083008e0098e0a0f0ac50b8d0c2d0cc00d820e3f0ec30f63000b00af014f01ff0278033f040004c305b206ef07f0086f08f009c00b100bbf0c4f0cf10db20e500ef30f7e002200c1017901ff02c6037f043f04f605af0710080f087a093f09c00a700b000bc20c7f0cf00e0a0e590f1e0faf003500f701af023e02c003b0045c054b062b06e9080008b709630a0b0a900b7d0c2f0c7f0d330e0f0e9f0f360fc5006f00f301b3027d02d003bf0470057b066b07c8083b08e309830a3c0ac60b690c180cb70d660e110ec60f3f003f0078013701ef027f0330040f04c005cc06a007f3085008fb099b0a400afd0b9f0c3e0cec0daf0e3e0ee00f8b002c00cf00f3021102be035e042f053f05ff0700080f0870093209dc0a570b250bc30c7f0cf00e0c0e6f0ef70faf003300ee018f023b02df03900468053f06380759080208a0095709ef0a3f0b370bef0c7f0d300e0f0e7f0f300fc0007f00f301c7027f02f303ce04700564067206d0083608d0098c0a100ae00b8b0c220cc00d8f0e100ebe0f20000f007f00f301ef0275033e03e904ba0592076b07ef084f08fb09ae0a350ae00b830c3c0cdf0d8e0e330f3f0f8c000c00b70166021302b7036c042004e305ce06cf07f0087f08f109c90a6a0b000bc30c6f0cf90db70e6f0ef50f93000000d1017d021f02c10379043f04ff05f007810809089f093709ea0a9d0b310bcf0c7f0cf00e0f0e700ef00fc3006f00fe01a2025f02f303cf04730551065e079f080a08ba09560a000abf0b450bf00cb30d500ebe0f3d0fcb00af00f701c702600330041f0470058f067107be084b08e0096f0a390ad50b8f0c1c0cd00d790e130ec30f50000f009f013601d102bf0337040304e005c606df07fc086f08ff099d0a4f0a7f0b9f0c3e0cff0d9f0e3f0ef00f8e001c00cb017d021102ef033d042004f505f00700080f087d092f09cb0a790b270bc00c7f0cf00e030e7f0efe0f8f003b00d801900233031e03b1046b0520063c076f080008b209570a0f0a710b310bdf0c720d300e0f0e730f340fc0007f00f701c1027f02fe03ef0473055f064707a9087f08c2097e0a100ac70b6a0c150cb00d7d0e130ecf0f30000f0078013501df0277032b03b004cf059c069f07ff084108f309b20a5e0aef0b8d0c2b0cd00d860e230eed0f5d000b00b3015d01f302ba035f041f049c05e0070f07f1087f08fa0a230a670b070ba30c6f0cf00dbf0e720f1d0f83003700ee0170021702ca037e043d04ff061f0730080c0899093509ef0a760af30bdf0c7f0cf00e080e700f300fbf004f00f701a7026f02f303bd046b055f064f078e081508c009630a0f0a910bb10bff0c9f0d300e0b0ea30f30000a007f00ff01cf02780332038504960568067707a9081408d7098c0a2e0ac20b890c270ca00d870e2f0ecf0f30000f007f013b01ef027f033b040d04c205b706ec07f7086f08f409b60a510af00b9c0c200cfd0d8f0e300ee10f7f001f00c3021d02bd038f043f04f705c606ff00fb0837092a09c00a710b1f0bc70c6f0cf00e0c0e750f1f0f9f004f00f3018f023b02d603960460053f06100769080608a609600a0f0a9f0b3f0bff0c760d300e0f0e730f360fc6007f00ff01b3026f02f003ef047c056f067007c3082708c7096f0a110ac00b7b0c100cb80d7d0e100ecf0f40000700af013001ff027a033003e204c4058b06a307fd086708ef09830a5c0aef0b9f0c3a0cef0d9f0e3a0edb0f5e001e00b00163021b02b40367042d04e305ed06e0080e0879093109b70a6c0b0c0ba60c6f0cf00e0c0e6f0ef60f8f003f00f1018f023202eb039d043f04fc062f07100809089f09330a3f0a780b300bff0c7f0cf00e0f0e730f3f0f99005f00f0018f023f02f703a804710553066f078d082c08c709670a200ace0b400bf10cbf0d300e0f0e700f3f0fcf007f00ff01cf027f033f041f049c059d069707b0083508e509810a3a0ad70b8f0c1c0cd00d800e300ee00f6b000e00bf013e01e002bf0330040304c005cf067f07ff087f08f809bb0a570b010bb10c5c0cef0d9f0e3f0f0f0f87002900ba0177022e02cf039b043f04ff05ff0710080f087f091f09c30a7c0b1e0bf00c7f0cf00e000e780f1f0f9f004000ff0192025702ef03830457052f06110761080008b809500a0f0a930b170bef0c9f0d370e0f0e730f3c0fc0007f00ff01bb026f02fb03c3049f067107d1083108e1098b0a100ac70b670c2d0cb30d650e100ecf0f30000f007b013b01ef026f0332040604b005b506b007d0085208f909900a300aff0b8f0c330ce20d9f0e300efd0f67000800b9015e022102b3036f040304f005ed06f001390873092f09c00a7f0b1b0ba50c5f0cf00db30e5f0f130f95003000e10182023a02e1038f043e053f061b0710080c089f093009ef0a730b3f0bcf0c730d300e0f0e7c0f300fc0007f00ff0193025f02f903be046a05490653079f081708c2097f0a030ac30b6a0bf80cbf0d300e0f0e700f380fdf007f00f101df027d031103e004b0058a06aa07ce084b08d009860a260ad00b800bf30cd70d8f0e1f0ec00f63000600bb015601fb02af033203f004df059606cf07f6086708e009c30a550af00bb10c5f0cf00d980e570ee20f7f001300ea016f021102cf0369043f04f005f90730080f0879093009e30a710b100bc00c7f0cf00e0f0e630f1d0f9f003900f5019c025002f903910477052006370747080608af09420a000acd0b390bfe0c9f0d300e0f0e9e0f360fd9005f00fb01bf023f02fe03bf0470057306720793083f08c0098e0a230ad10b700bfc0cb30d6f0e080eb20f5a0fdf007f00f701ef027f033103f704c305c706c107cf083808f2099f0a3b0aeb0b8d0c300cf10d9f0e330ee00f7a000700cd016601f702af0338041604d705e606ef07ff087f091f0a790b100bb00c6f0cfe0da10e580efa0f89003f00cf0180023302d3038f043f04f006300730080708af091b09df0a790b260bdf0c7f0cf00e0f0e7c0f260fbe005f00f001b7026d02f30398047f053f063607ad081008c509630a150ac90b6f0bf30cb00d6f0e050eaf0f3b0fc9007f00fd01be02a2031e03c30490058f067007ef083308e0099f0a370ac20b770c200cd00d800e3f0ecf0f3b000e00af013f01fe02af033f040004ef05c006cf07f5086f08f309ac0a520b0d0b940c5f0cfb0d970e6f0ef00f80003600c10170021802b60367042c04f705ed06f0080f087f08f109ea0a250b200bc70c6f0cfc0db20e630f1b0f9f003f00fd018b023202f603a7046b054f063b0760080f089709400a0f0a7f0b3b0bef0c7f0d300e0f0e7f0f3c0fc0007f00f001ca025e02f103cf04730558069607aa082308d0098f0a100ac10b7e0c1f0c7a0d730e0b0ea20f3d0fdf007f00f301cc027e033103f904b805d706c007f8085f08f709af0a320adf0b9f0c330ce70d890e300ee10f68001a00b70158021002b20361040304d305c006ef07fe086f08f009c00a740b000bcb0c6f0cf80db30e6f0ef00f7f001700d0018c021f02c70383043f04ff05fd0724080f087f09300a0f0a760b2d0bcf0c7f0cf00e0f0e770f200fb0006900b001b1026b02f003b3047005580633076b080008c509600a000abf0b4f0bf00cb00e070eb70f290fcf007f00f301c6026f02f303df0476056d069707a5083908d209870a290ad00b8f0c120cbe0d6f0e190eb10f5c003f009f013001ff027f0339040704c305c906df07ff084c08f409eb0a470aef0b9f0c300cf70da30e590ee00f8e001600c0018a021302b00363042a053f05e60700080e087b093309d80a700b3f0bc00c7f0cf00e060e6f0efb0f8f003800d8017f023002ff03800461053a0610077b080908a009600a0f0a7f0b300bef0c700d300e0f0e790f300fb9007f00f001bd0263031c03bb04690557066b06e3082c08c2096f0a100abe0b620c160cb00d6a0e130ecf0f3f0fcf0078013201d90279033003f90496059f067b07d0085708e009960a570ae40b8b0c210ce70d800e300ee00f7d000e00b0016b01f702a7036f040e04fa05e406cf07f3086f08f109b00a6c0b0f0b8f0c3f0cf00dbc0e5f0ef00f7d003000e7018f021302c00373043f04f905f60720080f087f093d099f0a760b330bdf0c7f0cf00e0f0e7a0f1b0fab005600f301cf023602f003b6045f053006600783081108bd09400a030abd0b430bfa0c9f0d300e0f0e7f0f3d0fd0007f00fe01ce027f031603cf0470057b066e07c8083f08c709800a370ac00b810c3d0ccf0d800e320ecb0f30000f007f013101ef029f033003fd04c005ca06bf07f1086f08f809bf0a300b090ba30c5a0ce30d9f0e350ee00f7f001c016f020f02c3037f041d04c005ec06ef07ff087108f709c90a7c0b100bc10c7f0cf30dbc0e730f1f0f9b002300d10180023802dd038f043b053f06130730080008b309500a0f0a9e0b460bdf0c780d3f0d9f0e7f0ef00fcb005f00f301bf023f02f803bf04750561067a078f081008ca09610a1e0a950b6f0bf00cbd0d6b0e000eb60f300fef007f013001d6027f031703cf0493058306bd07cf084408f0099f0a360adf0b8b0c300cfd0d830e3d0ec90f5d000c00a3016f01fe02a00379040304ec05c306ff07f0087f08f009b30a660b200bba0c5f0cf00dbd0e5f0efa0f90003f00c7018d023502e0036d042f04f205f1070f080f0870093c09df0a720b260be30c700d300e0f0e7f0f1a0f9f004000fb019f024002ff0393047d04ff064806ff081008b009770a070aaf0b3d0beb0c9f0d310dbf0e7f0f3d0fcf007f00f601cf027902ff03c404a6058e06670792083608df09330a360ac00b8f0c1f0cc00d730e1f0eca0f50000f0076013501ef027f033003f304b305d806b607f0086f08ff09980a500b030ba70c3b0cdf0d8a0e300ee60f79001900bd016f020d02b70364042b04e005f0071f07f1087f08f009b60a610b300bc30c6f0cf00e000e790f100f9f003100f8019f021902d6038f043f04ff05f70720080008bc09400a010a6b0b400bff0c9f0d300e0f0e7f0f050fb0006f00f501b3026f02f003b9055f063707c6082308c209580a140ab60b6f0bff0c7f0d4f0e000eb90f320fef007f00f901d00
Print End

サンプリングレートを16000にして取得してみました。

このデータを上記のサイトでHEXデータを変換してファイル保存します。このファイルをAudacityでRAWデータで読み込みます。

設定はこんな感じで、サンプリング周波数を取得と同じ数値にします。

取り込めました。

700Hzぐらいですので大丈夫そうです。

50,000sps

さっきよりポイントが増えていますね。

75,000sps

増えました!

あれ、、、データが荒れている、、、

I2S_BUFFER_SIZEを512から1024に増やしてみました。前半のデータが安定しました。

後ろのデータは荒れたままですね、、、

I2S_BUFFER_COUNTを4から8に上げたら安定しました。この辺は低速だとよくわからないパラメーターだったのですが、速度あげると結果に差が出ちゃいますね。

周波数も700Hzぐらいなので大丈夫そうです。

100,000sps

また荒れてきました。バッファは1024より大きくするとハングアップするので限界みたいです。数も8から16に増やしても変わらずでした。先頭部分は安定していますが、残りはぐだぐだですね。先頭だけだったら使えるかな?

102,400sps

念の為、1024の倍数化してみましたが変わりませんね。

500,000sps

一応データは取得できますが、さすがに使えないデータですね。Audacityの上限が384000みたいですね、、、

1,000,000sps

さすがにぼろぼろになります。

まとめ

75Kspsぐらいまでであれば安定して取得できそうです。13ナノ秒間隔ぐらいなのでこの辺がESP32の限界かな?

100Kspsをできれば使いたいですが、先頭部分だけきれいに取得できればいいんですが、次回以降に調整しながら試したいと思います。

コメントする

メールアドレスが公開されることはありません。

管理者承認後にページに追加されます。公開されたくない相談はその旨本文に記載するかTwitterなどでDM投げてください。またスパム対策として、日本語が含まれない投稿は無視されますのでご注意ください。