Notifications
Clear all

Arduino (as signal generator) to ADS1115 to Raspberry Pi (using FFT to evaluate frequency)

3 Posts
2 Users
1 Likes
957 Views
(@jimstokes)
Member
Joined: 3 years ago
Posts: 3
Topic starter  

Sorry if the topic title is a little awkward.   What I am trying to do, ultimately, is to receive input from a guitar (as a signal) through an Analog to Digital Converter (ADS1115) into a Raspberry Pi 4B so that it will tell me which note I just played.  This is a starting point for a much larger project that will determine which chords are being played (even if one note at a time).

But, my current problem:

1. I have created (copied from others, really) a signal generator using Arduino that outputs at 2.5V.  It asks for user input as to the frequency desired, then gives a steady stream output at that frequency.  Works very well and I have measured both voltage and frequency on multimeter and get good and stable results.

2. I can connect the output from the Arduino (signal generator) to a Analog to Digital Converter, which is connected to the Raspberry Pi GPIO, which then displays representative values on the screen.  This seems to give low and high readings fairly consistently, and seemingly in accordance with the output of the signal generator. As such, I believe I could take these values and do an FFT conversion that would tell me what frequency was being received.

So, my question, (disclosing up front that all of this is quite new to me, but I am learning....slowly....):

1. Can anyone point me towards a good demonstration of how the data needs to be collected from the GPIO  and formatted so that it can be used in the FFT (Fast Fourier Transformation)?  I'd like to use an array in virtual memory rather than writing/reading a file.

Thanks in advance for any responses.

Jim in Guelph, Ontario, Canada.


   
Quote
(@borkutip)
Member
Joined: 3 years ago
Posts: 6
 

Hi Jim,

This is a very interesting project. I am afraid that I can not write anything usable, because I did not do anything similar to this, but I found two (maybe usable info) for you:

CLAM project (C++ music library):
http://clam-project.org/wiki/Music_Annotator
Here there is a ChordExtractor, which probably helps you. I do not have any experience with this library.

I think, that if you start using this library, you can find a way to solve your GPIO-data-collecting problem.

And I found a free Coursera course:

https://www.coursera.org/specializations/digital-signal-processing

I did not take this course, but maybe...

Cheers
Péter

 


   
JimStokes reacted
ReplyQuote
(@jimstokes)
Member
Joined: 3 years ago
Posts: 3
Topic starter  

Another approach may be to use Pyaudio, if I could figure out how the I2C address (0x48) can be interpreted in the form of 'input_device_index' required by Pyaudio.

Any help is appreciated.

Jim.


   
ReplyQuote