arduino fft


That being said on with today’s project, what we have here is a nano, an OLED screen and a little amplified electric microphone. So what are we gon na do with all this? You ask: we are going to make in our dueo based spectrum analyzer very cool, very easy I’ve seen a few of these done on YouTube. I check them out and they are all using this f IX, underscore FFT, fixed, fast, Fourier, transform library makes it really simple. Alright let’s check out and go over the hardware here, really quick. So we got the Nano from the Nano we have: 5 volt and ground going up to the bus. Now we have 5 volt and ground from the OLED going to the bus, 5, volt and ground from the microphone going to the bus. Now the microphone output, which is an analog output, feeds back into a 0 and, of course, for the OLED SDA comes over to a 4 and SCO goes over to a 5 and man that is it there ain’t nothing else to it now, for we go check Out the code take a look at this little microphone unit. This is a this is pretty nice. You want to focus today, really come on focus there you go. So this is the adjustable gain microphone name she’s got a little adjustment pot there and a nice little amplifier and like ice. This is from Lady ADA in New York City. Although I’m sure you could find one from our friends in China and speaking of our friends in China, I got a double thumbs up.

Announcement. Banggood has decided to sponsor me by sending me stuff to play with so I’m very excited about this. My first shipment of stuff to play with was shipped out today and today is the 27th of April, so we’ll see how long it takes to get here. I’M. Expecting four weeks all right on to the code. Alrighty let’s look at the code for the Arduino spectrum. Analyzer now the black magic which we’ll get to in a bit I’ve copied from a sketch by CB m80 Amiga on YouTube and the six FFT library is available here on github. So, first of all, we need to include the fix, FFT library, the SPI library, which you can probably admit if you’re running low, on memory, the I squared C library, which you cannot omit because we need it for the OLED, the Adafruit, graphics library. We need because we’re drawing things on the screen and the OLED driver, then we need to define this OLED reset for because the library uses it we’re not using it, then we’re going to declare an instance of the Adafruit SSD 1306 called lower case display with that Oled reset value – or you could just put 4 in there and be happy with it, we’re, going to declare a couple of data arrays for the FFT and a couple of variables for drawing the graphics and some counters that we will use to count. Now, in the setup we have serial begin at 9600.

You know because we always use our serial comms to debug we’re, going to start the display ssv 1306, which a PVC see what the hell that means, but it’s there anyway and for my particular display. We need that hex address, Oh x3c, because the Adafruit library looks forward to collects 3d a little display, setup and we’re going to set our analog voltage reference to default. So it uses the 5 volt reference. So now we’re going to come down here and we’re, going to set our minimum and maximum values for the analog to digital converter and then we’re going to take a hundred twenty eight samples from a zero and write them to Val and then we’re going to start Populating this array data with Val divided by four minus 128, to knock our frequencies out of there and then I am – will be equal to zero. Then we’re, just going to capture the minimum and maximum values we can use them. I didn’t use them here and then here is the six FFT which is performed on data, and I am with these other two arguments. If you want to know more about them, check out the FFT dot, cpp next we’re going to clear the display again and then we’re going to do this black magic. This is the part I got from CBM 80 Amiga interviewed that equal square root the data I times data – I plus I mi times i mi, and that supposedly filters out the low noise and Nam and then we’re going to draw our lines for each frequency.

We’Re. Breaking it out, as you see here into 64 separate frequencies, and it will draw a line for each one, based on the value of the line limit minus your data, then we’re going to put the cursor at the top princeton title and show what we got all Right, are you guys ready to see it in action power it up here and there you go. You can see that there, it says spectrum analyzer and you can see there’s just a little bit of noise there for me talking and whatnot how about we bring in some YouTube approved copyright, free music Applause. How about that an art, weena spectrum, analyzer it’s, even picking up my voice, hello, yep, picks up my voice, so there you have it. I hope you enjoyed it. If you did give me a big old thumbs up, don’t forget to subscribe so that you can win that power supply and feel free to comment. That’S.


arduino fft Video







arduino fft news








arduino fft Social






👋 Want to bring Tony Stark-like gesture control to your projects? Learn how with the BLE-enabled MKR WiFi 1010 and Nano 33 BLE Sense boards using the ArduinoBLE library.
safe image.php?d=AQDyi1ELcW4VGzhx&w=720&h=720& dChOhNMmeF - arduino fft

Arduin-yo ho ho! A fairground favorite, the pirate ship is a fun way to explore the oscillation of a pendulum. How much fun, you ask? Access our Science Kit Physics Lab preview and see for yourself:

🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today:

70537898 550174072395145 8798850142103928832 n.jpg? nc cat=102& nc oc=AQmCfMPwMf1oPpYqFhzbxfnGdbrmsjZXrEEBy1ox5Z8EJtiYMADoFNZ5mnSNRgCCY74& nc ht=scontent - arduino fft

Object @Generate 2015 (walking)



Originally posted 2018-01-11 15:45:45.

(Visited 335 times, 3 visits today)

About The Author

You might be interested in

Comment (33)

  1. Thank You for amazing video and sharing information; can we have full audio spectrum display? i.e 20 Hz to 20kHz?

    1. Prasanna Gunasinhe
      That’s really pushing the limits of the Arduino’s analog sampling rate, even with the ADC prescaler set for fast sampling.

  2. how about the range of from which the sound came from, how far can it detect the sound frequency, lets say a chainsaw

  3. ihey coool video. would it be posibel to make a tutorial where a arduino recieving and information on a specific frequenzy. just so we can get an idea about how radio signals are decoded.

  4. PARECE QUE LA RESPUESTA NO TIENE NADA QUE VER con la realidad, solo simula el espectro porque ¿como una bocina de cel va mover frecuencias bajas al extremo de la grafica?

  5. this project is pretty amazing. i just want to ask if i can replace the microphone to a 3.5 mm female jack and connect my phone on it? i want to get the output spectrum of music coming from my phone.
    Thanks in advance sir. I already subscribed 🙂

    1. @learnelectronics oh thank you very much sir!!! . the purpose of what i ask is for music scoring of out final project thank you very much it will help a lot 😀

  6. Hello, it seem that the library fix_fft.h doesn’t exist anymore in the GitHub link. Instead it seems to be another library called arduinofft.h, but the fuctions seems to use slightly different variables.

    1. Unfortunately, I have the same problem. How you found a solution for this one? Or does anyone have the library? Please share with us.

  7. Can an accelerometer be used instead of microphone ….we are working on vibrational analysis ..need some suggestions

    1. Sure ! I did an experiment like that at work not too long ago ! FFT of your vibrations data over time will give you the amplitude of the vibration over each frequency.

  8. Hello, I really like the idea. I was wondering is there a way that this setup can be implemented on 32×64 RGB led Matrix board?

  9. I need to filter in a noisy hambient a specific sound and to “set On” an alarm: any suggestion? Thanks in advance, Sergio

    1. You could do fft on your audio signal, target the desired frequency and set your alarm off when a peak of a certain amplitude at your target frequency is detected

  10. I see you using a microphone here . Can you make a spectrum analyzer with an ultrasonic receiver sensor for ultrasonic spectrum 45khz to 100khz range? I see people with bat detectors and i can use this to check bearings in machinery. Thank you for your video.


Your email address will not be published. Required fields are marked *