Code Monkey home page Code Monkey logo

pico-pdm's Introduction

pico-PDM

Raspberry Pi Pico (RP2040) PIO-based PDM input to I2S output example.

Run

cargo run --release

詳しくは .cargo/config.toml のrunnerを確認してください。
probe-runを用いて書き込みます。

pico-pdm's People

Contributors

akiyukiokayasu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pico-pdm's Issues

高速化

ステレオのPDM→PCM変換で230.4MHzまでオーバークロックしている。
もっと高速化したい。

  • ループ展開
  • コンパイルオプション見直し
  • RAM実行
  • cic-fixedのプロファイル

稀にI2Sが0値を出力する

PDM→PCM変換が間に合っていない時に0値を出力するようになっている。
XIPのキャッシュミスで速度が安定しない可能性がある。
RAM実行に書き換えることで改善するか?

8サンプルごとにI2S出力にプチノイズ

I2S出力の値が16サンプルごとに少し飛ぶ。

16サンプルはバッファーサイズ。
バッファーサイズを32サンプルにしたときは48サンプルごとに飛んでいたっぽい。不思議なので要検証。

PDMかI2Sのダブルバッファリングに問題があるのではないかと思う。

PDMマイクの初期化中のゴミデータも積分してしまう

PDMクロック送信開始後33ms程度はゴミデータしか返ってこない。
ほぼPDMデータは0が返ってくるので負のオフセットがついてしまう。

考えられる解決策

タイマーで40ms後に割り込み、積分データを0にリセットする

LchとRchが1サンプルずれる可能性がある

PDM→PCM変換のdequeueに格納するタイミング次第ではLchとRchが1サンプルずれる可能性がある。

1ch目(Lch)のときに全チャンネル分をdequeueから取得するなどしてサンプルがずれないようにしたい。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.