Weekend project - spectrum analyser

XCore Project reviews, ideas, videos and proposals.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Weekend project - spectrum analyser

Post by infiniteimprobability »

This is quick hack up using:

- mic array decimating from PDM to 32kHz PCM
- Hacked out version of our VNR (voice to noise ratio estimator) features front end
- 1024pt FFT with MEL filter bank to give log frequency bins
- magnitude to get real power of each bank
- Log2 to get log amplitudes
- Bit bashed 6x SPI driver to drive a HUB75 Ali-express display
- A bit of nasty code to triple buffer and do peak hold etc.

[bbvideo]https://www.youtube.com/watch?v=Mf4doqMc--c[/bbvideo]

DSP runs at 63FPS in single thread with plenty of MIPS left, mic array is a single thread, renderer is a single thread and the display driver (not optimised) is a single thread running at 140+ FPS

If there is interest in it, I'll tidy it up and post the code.. It's a bit messy at the moment


User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Funky beats!
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

Amazing project! True 1/3 octave filters without FFT working entirely on one core would be nice.
Redeye
XCore Addict
Posts: 131
Joined: Wed Aug 03, 2011 9:13 am

Post by Redeye »

MaximLiadov wrote: Fri Jul 21, 2023 10:45 pm Amazing project! True 1/3 octave filters without FFT working entirely on one core would be nice.
It's probably possible in a single thread with a combination of quadrature mirror filters and elliptic bandpass filters, then pass the filtered outputs to a second thread to do the ballistics.
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Hi All,
Thanks for your interest! Who doesn't like flashy lights? I have pushed a mildly tidied version of this app to my fork of the xcore_sdk repo here:

https://github.com/ed-xmos/xcore_sdk/tr ... s/spectrum

I'll see if I can get another video showing how it responds to pure tones. With the PDM mic wide frequency range, large FFT and high precision feature extraction, it should be reasonably accurate. Note nyquist is 16kHz. I tried 24kHz but for normal audio sources a large swathe of the screen on the right didn't show anything interesting.