Fast Fourier Transforms. Spectrum Analyzers. Waterfall displays. Not long ago, such terms were reserved for high end test gear. But oh, how things have changed! It’s no surprise to many Hackaday readers that modern microcontrollers have transformed the scene as they become more powerful and as a result are endowed with more and more powerful software libraries. [mircemk] has used such a library along with other open source software combined with mostly off the shelf hardware to create what he calls the DIY FFT Spectrum Analyzer. Rather than being a piece of test gear, this artful project aims to please the eye.
The overall build is relatively simple. Audio is acquired via a line-in jack or a microphone, and then piped into an ESP32. The ESP32 runs the audio through the FFT routine, sampling, slicing, and dicing the audio into 16 individual bands. The visual output is displayed on a 16 x 16 WS2812 Led Matrix. [mircemk] wrote several routines for displaying the incoming audio, with a waterfall, a graph, and other visualizations that are quit aesthetically pleasing. Some of them are downright mesmerizing! You can see the results in the video below the break.
Of course the build doesn’t stop with slapping some hardware and a few passive components together. To really be finished, it needs to be encased in something worth displaying. [mircemk] does not disappoint, as a beautiful 3D-printed enclosure wraps it all up nicely.
We think that the final product is great, and it reminds us of some of the very things that inspired us early on in our hacking careers. We would love to see this project integrated with an Interactive Musical Art Installation of any kind, the more esoteric the better. Perhaps a 555 timer synth could fit the bill? Be sure to share your own hacks with us via the Tip Line!
Continue reading “Art Project Fast And Fouriously Transforms Audio Into Eye Candy”
Oftentimes in computing, we start doing a thing, and we’re glad we’re doing it. But then we realise, it would be much nicer if we could do it much faster. [Ricardo de Azambuja] was in just such a situation when working with the Raspberry Pi Zero, and realised that there were some techniques that could drastically speed up Fast Fourier Transforms (FFT) on the platform. Thus, he got to work.
The trick is using the Raspberry Pi Zero’s GPU to handle the FFTs instead of the CPU itself. This netted Ricardo a 7x speed upgrade for 1-dimensional FFTs, and a 2x speed upgrade for 2-dimensional operations.
The idea was cribbed from work we featured many years ago, which provided a similar speed up to the very first Raspberry Pi. Given the Pi Zero uses the same SoC as the original Raspberry Pi but at a higher clock rate, this makes perfect sense. However, in this case, [Ricardo] implemented the code in Python instead of C as suits his use case.
[Ricardo] uses the code with his Maple Syrup Pi Camera project, which pairs a Coral USB machine learning accelerator with a Pi Zero and a camera to achieve tasks such as automatic licence plate recognition or facemask detection. Fun!
Here’s a Big Mouth Billy Bass with extra lip thanks to Alexa. If you’re not already familiar, Big Mouth Billy Bass is the shockingly popular singing animatronic fish designed to look like a trophy fish mounted to hang on your wall. In its stock condition, Billy uses a motion sensor to break into song whenever someone walks by. It’s limited to a few songs, unless you like to hack things — in which case it’s a bunch of usable parts wrapped in a humorous fish! Hackaday’s own [Bob Baddeley] combined the fish with an Amazon Echo Dot, connecting the two with an ATtiny84, and having Billy speak for Alexa.
[Bob] had a few problems to solve, including making Billy’s mouth move when there was audio playing, detecting when the Echo was on, moving the motors and playing the audio. After a bit of research and a lot of tweaking, a Fast Fourier Transform algorithm designed for the ATtiny was used was used to get the mouth moving. The mouth didn’t move a lot because of the design of the fish, and [Bob] modified it a bit, but there was only so much he could do.
It’s all well and good for the fish to lie there and sing, but [Bob] wanted Billy to move when Alexa was listening, and in order the detect this, the best bet was to watch for the Dot’s light to turn on. He tried a couple of things but decided that the simplest method was probably the best and ended up just taping a photo-resistor over the LED. Now Billy turns to look at you when you ask Alexa a question.
With a few modifications to the Dot’s enclosure, everything now fits inside the original mounting plaque and, after some holes were drilled so the Dot could hear, working. Billy has gone from just a few songs to an enormous entire library of songs to sing!
We’ve seen Alexa combined with Big Mouth Billy Bass before, but just demos and never an excellent guide like [Bob’s]. The nice thing about this guide is that once you’ve hacked the hardware, it’s a breeze to add new functionality using Alexa skills.
Continue reading “Big Mouth Billy Bass Channels Miley Cyrus”
Every machine has its own way of communicating with its operator. Some send status emails, some illuminate, but most of them vibrate and make noise. If it hums happily, that’s usually a good sign, but if it complains loudly, maintenance is overdue. [Ariel Quezada] wants to make sense of machine vibrations and draw conclusions about their overall mechanical condition from them. With his project, a 3-axis Open Source FFT Spectrum Analyzer he is not only entering the Hackaday Prize 2016 but also the highly contested field of acoustic defect recognition.
For the hardware side of the spectrum analyzer, [Ariel] equipped an Arduino Nano with an ADXL335 accelerometer, which is able to pick up vibrations within a frequency range of 0 to 1600 Hz on the X and Y axis. A film container, equipped with a strong magnet for easy installation, serves as an enclosure for the sensor. The firmware [Ariel] wrote is an efficient piece of code that samples the analog signals from the accelerometer in a free running loop at about 5000 Hz. It streams the digitized waveforms to a host computer over the serial port, where they are captured and stored by a Python script for further processing.
From there, another Python script filters the captured waveform, applies a window function, calculates the Fourier transform and plots the spectrum into a graph. With the analyzer up and running, [Ariel] went on testing the device on a large bearing of an arbitrary rotating machine he had access to. A series of tests that involved adding eccentric weights to the rotating shaft shows that the analyzer already makes it possible to discriminate between different grades of imbalance.
A spectrum analyzer is a pretty useful tool for working with signals where the size of the frequency components matter. Usually, the display is a screen. Sometimes, you see it done with LEDs. [Mag Laboratories] did it with ping pong balls.
The device uses a processor to calculate a Fourier transform, cutting an audio signal into 16 frequency bands. The processor converts each of these values to a PWM output that drives small fans. The fans blow the ping pong ball up the tube proportional to the fan speed. You can see the result in the video below.
Continue reading “Ping Pong Spectrum Analyzer”
What if you could give yourself a standard eye exam at home? That’s the idea behind [Joel, Margot, and Yuchen]’s final project for [Bruce Land]’s ECE 4760—simulating the standard Snellen eye chart that tests visual acuity from an actual or simulated distance of 20 feet.
This test is a bit different, though. Letters are presented one by one on a TFT display, and the user must identify each letter by speaking into a microphone. As long as the user guesses correctly, the system shows smaller and smaller letters until the size equivalent to the 20/20 line of the Snellen chart is reached.
Since the project relies on speech recognition, the group had to consider things like background noise and the differences in human voices. They use a bandpass filter to screen out frequencies that fall outside the human vocal range. In order to determine the letter spoken, the PIC32 collects the first 256 and last 256 samples, stores them in two arrays, and performs FFT on the first set. The second set of samples undergoe Mel transformation, which helps the PIC assess the sample logarithmically. Finally, the system determines whether it should show a new letter at the same size, a new letter at a smaller size, or end the exam.
While this is not meant to replace eye exams done by certified professionals, it is an interesting project that is true to the principles of the Snellen eye chart. The only thing that might make this better is an e-ink display to make the letters crisp. We’d like to see Snellen’s tumbling E chart implemented as well for children who don’t yet know the alphabet, although that would probably require a vastly different input method. Be sure to check out the demonstration video after the break.
Don’t know who [Bruce Land] is? Of course he’s an esteemed Senior Lecturer at Cornell University. But he’s also extremely active on Hackaday.io, has many great embedded engineering lectures you can watch free-of-charge, and every year we look forward to seeing the projects — like this one — dreamed and realized by his students. Do you have final projects of your own to show off? Don’t be shy about sending in a tip!
Continue reading “Students Set Sights On DIY Eye Exams”
If you do any electronics work–especially digital signal processing–you probably know that any signal can be decomposed into a bunch of sine waves. Conversely, you can generate any signal by adding up a bunch of sine waves. For example, consider a square wave. A square wave of frequency F can be made with a sine wave of frequency F along with all of its odd harmonics (that is, 3F, 5F, 7F, etc.). Of course, to get a perfect square wave, you need an infinite number of odd harmonics, but in practice only a few will do the job.
Like a lot of abstract concepts, it is easy to understand the basic premise and you could look up any of the mathematical algorithms that can take a signal and perform a Fourier transform on it. But can you visualize why the transform works the way it does? If you can’t (or even if you can), you should check out [Mehmet’s] MATLAB visualization of harmonic circles. If you don’t have MATLAB yourself, you can always check out the video (see below).
Continue reading “Visualizing The Fourier Transform”