Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 3.09 KB

README.md

File metadata and controls

56 lines (35 loc) · 3.09 KB

microdsp Zephyr demos

This is a collection of demos showing how to do real time, full duplex audio processing on a microcontroller using Zephyr (nRF Connect SDK) and the microdsp Rust library (scroll down for videos).

The microdsp_demos Rust crate contains the demo apps and is added to the Zephyr build using zephyr_add_rust_library.

The demo apps have been tested with nRF Connect SDK v2.1.2 and the following boards.

Demos

In the videos below, an nRF52840 DK board is used together with breakout boards for a WM8940 audio codec and an analog MEMS microphone. KiCad projects and JLCPCB fabrication files for these breakout boards are available here.

Normalized least mean squares filter

This demo shows how to use a normalized least mean squares (NLMS) filter to reduce leakage of sound from the speaker in the signal recorded by the microphone.

nlms.mov
  • Button 1 - Toggle speaker output
  • Button 2 - Toggle NLMS filter
  • Button 3 - Toggle recording
  • Button 4 - Toggle playback
  • LED 1 - On when speaker output is active
  • LED 2 - On when the NLSM filter is active
  • LED 3 - On when recording
  • LED 4 - On when playing back recording

MPM pitch detection demo

A (very) simple ukulele tuner. Each of the four LEDs turns on when a pitch close to the corresponding ukulele string is detected.

mpm.mov
  • LED 1 - On when the pitch is close to 392 Hz
  • LED 2 - On when the pitch is close to 262 Hz
  • LED 3 - On when the pitch is close to 330 Hz
  • LED 4 - On when the pitch is close to 440 Hz

Spectral flux novelty detection demo

This demo shows how to detect transients and "starts of sounds" using spectral changes over time rather than just signal amplitude changes.

sfnov.mov
  • LED 1 - Toggles between on and off for each detected novelty peak

Selecting which demo to build

The microdsp_demos Rust crate is compiled as part of the Zephyr build using zephyr_add_rust_library, which is called from CMakeLists.txt. The EXTRA_CARGO_ARGS argument is used to specify which demo app to build by enabling one of the following cargo features:

  • nlms_demo - Normalized least mean squares filter demo
  • sfnov_demo -Spectral flux novelty detection demo
  • mpm_demo - MPM pitch detection demo