In my project I want to check the sound emission of a motor (current status of the project), for analyzing anomaly purposes (2nd part of the project). For this reason I've placed a piezo sensor on it for reading the voltage. The goal is to transform this acquired data into frequency spectrum with a sample amount about 50k, save it in a csv file and send the file with the whole dataset via a NRF24L01+ module to a raspi 3.
The datasheet of the Pico says it has a sampling rate of 500k.
Apparently this is only achievable if the values are written directly into the the ram registers (DMA = Direct Memory Access).
What's the max sampling rate i could achieve without DMA, without jittering?
Is there a reasonable benchmark test for checking how many samples I actually could get in a second?
If not, how would a code snippet look like to approve the true sample amount? I need to verify that I've a good amount of dataset to progress further.
For the FFT part, I've been trying to use Peter Hinch's repo:
https://github.com/peterhinch/micropython-fourier (FFT), which gave me the following error:
I can only assume it has to do with using a different board (pyboard). What would i have to do to adapt to the Pico?Traceback (most recent call last):
File "<stdin>", line 63, in fft
SyntaxError: unsupported Thumb instruction 'rbit' with 2 arguments
File: dft.py
Finally I've had found this https://www.hackster.io/AlexWulff/adc-s ... ico-f883dd
which has already done most of the work i needed, but it is written in C/C++ and I'd like to stick to micropython.
Any advices, help or hints are welcomed and appreciated. Bear with me, I'm still new to this whole coding thing and I'm trying really hard.
further sources:
https://github.com/jbentham/rpi
https://iosoft.blog/2020/06/11/fast-dat ... pberry-pi/ (DMA)
https://iosoft.blog/2020/11/16/streamin ... pberry-pi/ (DMA)