atomic14/m5stack-core2-audio-monitor

Improvements

Closed this issue · 3 comments

Signal quality could be significally improved with the following minimal code modification:

  1. In main.cpp
    .sample_rate = 64000, // this expands frequency range to 8 kHz
  2. In I2SSampler.cpp
    //// int16_t i2sData[1024];
    int16_t i2sData[2048];
    // read from i2s
    //// i2s_read(sampler->m_i2sPort, i2sData, 2048, &bytesRead, 10);
    i2s_read(sampler->m_i2sPort, i2sData, 4096, &bytesRead, 10);
    //// for (int i = 0; i < bytesRead / 2; i++)
    for (int i = 0; i < bytesRead / 2; i+=2)

Photos show aquired signal before and after modification.
before

after

This is great - would you like to create a pull request and we can merge your changes in?

@cgreening
Sorry, I'm not experienced enough in git.
I tried to fork, clone, fetch, checkout, ets., but faulty.
So, please do it yourself.

Closed by 77d1284