Giter VIP home page Giter VIP logo

armdeveloperecosystem / audio-spectrogram-example-for-pico Goto Github PK

View Code? Open in Web Editor NEW
39.0 3.0 5.0 447 KB

Example project showcasing how to use a Raspberry Pi Pico, Adafruit's PDM MEMS Microphone Breakout, and Adafruit's 2.0" 320x240 Color IPS TFT Display with microSD Card Breakout to "See sound in real-time". ๐Ÿ”Š ๐Ÿ‘€

License: Apache License 2.0

CMake 32.98% C 67.02%
dsp cmsis-dsp raspberry-pi-pico rp2040

audio-spectrogram-example-for-pico's Introduction

Audio Spectrogram Example for Pico

Example project showcasing how to use a Raspberry Pi Pico, Adafruit's PDM MEMS Microphone Breakout, and Adafruit's 2.0" 320x240 Color IPS TFT Display with microSD Card Breakout to "See sound in real-time".

This project also leverages Arm's CMSIS-DSP library for optimized on-board digital signaling processing.

Hardware

Default Pinout

Frizting Diagram

+---------+-------------------+     +---------+-------------------+
| PDM Mic | Raspberry Pi Pico |     | ST7789  | Raspberry Pi Pico |
|---------+-------------------|     |---------+-------------------|
|    3V   |        3V3        |     |   VIN   |        3V3        |
|---------+-------------------|     |---------+-------------------|
|    GND  |        GND        |     |   GND   |        GND        |
|---------+-------------------|     |---------+-------------------|
|    SEL  |        GND        |     |   SCK   |      GPIO18       |
|---------+-------------------|     |---------+-------------------|
|    DAT  |       GPIO2       |     |   MOSI  |      GPIO19       |
|---------+-------------------|     |---------+-------------------|
|    CLK  |       GPIO3       |     |   CS    |      GPIO17       |
+---------+-------------------+     |---------+-------------------|
                                    |   RST   |      GPIO21       |
                                    |---------+-------------------|
                                    |   D/C   |      GPIO20       |
                                    +---------+-------------------+

Cloning

git clone --recurse-submodules https://github.com/ArmDeveloperEcosystem/audio-spectrogram-example-for-pico.git

Building

  1. Set up the Pico C/C++ SDK
  2. Set PICO_SDK_PATH
export PICO_SDK_PATH=/path/to/pico-sdk
  1. Change directories
cd audio-spectrogram-example-for-pico
  1. Create build dir, run cmake and make:
mkdir build
cd build
cmake .. -DPICO_BOARD=pico
make -j
  1. Copy audio_spectrogram.uf2 to Pico when in BOOT mode.

License

Apache-2.0 License


Disclaimer: This is not an official Arm product.

audio-spectrogram-example-for-pico's People

Contributors

ep1cman avatar sandeepmistry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

audio-spectrogram-example-for-pico's Issues

Arduino code ?

Hello,
excellent project, congratulations !
Can you translate please this code to use it with Arduino ?
I need to add it in my audio project (radio receiver) if I can, to see audio spectrum
Thank you in advance

Sampling size

Great project Sandeep!

I was wondering why you do the sampling on FFT/2 samples (=128) and not on INPUT_BUFFER_SIZE (=64):
new_samples_captured = pdm_microphone_read(capture_buffer_q15, FFT_SIZE / 2);
vs.
new_samples_captured = pdm_microphone_read(capture_buffer_q15, INPUT_BUFFER_SIZE);

You do have an array length guard in the read function so your samples variable will be reset to 64 anyway.
Am I missing something?

Thank you!

PS: There is also a small typo with the name of the variable magnitude.

Use smaller display , vertical scrolling not working

I had a 240x240 screen laying around and wanted to use that, but the vertical scroll is not working. After digging into the datasheets I found that there is a separate register that can be used to define the scrolling area, by default it did not fit to the 240x240 display.

My fix would be to add this lien to st7789.c but as this is a separate git lib, but still owned by you guys then I would first ask if this could be a solution?

    uint16_t bfa = ST7789_MAX_HEIGHT - height;

    // VSCRDEF (33h): Vertical Scrolling Definition TFA - VSA - BFA
    st7789_cmd(0x33, (uint8_t[]){ 0x00, 0x00, ((height >> 8) & 0xFF), (height & 0xFF), ((bfa >> 8) & 0xFF), (bfa & 0xFF)}, 6);

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.