LED and circuit structure
Arduino program that controls the LEDs
Graph of filtered white noise
Graphs of the overlayed frequencies and the magnitudes corresponding to each one
LED setup on the Arduino and C# Fourier program
Graph of fourier transformation
Fourier in Wolfram
3Blue1Brown's video first inspired us to research the idea of a fourier transformation. Intrigued by this fascinating concept, we wanted to experiment with its possible applications and test how it would map out in real life. Thanks to this opportunity we were able to do just that. Additionally, Hubert's difficulty in processing different sounds motivated us to assist his hearing with a visual display.
What it does
The device measures the power or magnitude of the most prevalent frequency of sound. The pressure of air is measured by the laptop mic for every small delay. A fourier transformation is applied to the pressure measurements to get the individual frequencies and then plotted on a magnitude to frequency graph. The graph is analyzed for possible white noise frequencies through Arduino and those are removed in the output, which is presented to the LEDs.
How we built it
We first used wolfram technologies to confirm the accuracy of a fourier transformation. The circuit was constructed with 12 LEDs, 4 different colored groups of 3, with connections to 220 ohm resistors. The 12 output pins of the arduino were utilized as output for lighting up each one. The program was written in C# and created a graph of magnitude to frequency using input data from a microphone. The program creates the graph by running a fourier transformation on the given sound wave and then outputting the individual magnitudes of the frequencies the original sound was composed of. The program then computed the most prevalent frequency and wrote the value of the magnitude of its frequency to the serial port. From there, the Arduino read in the values from the serial port, and based off this information lit the corresponding LEDs.
Challenges we ran into
One of the main challenges we faced was transferring the data the C# program computed over to the Arduino. Originally our idea was to first print the data to a file and then have the Arduino read from the file, but we soon found out that we could only do this from an SD card which we did not have. This left us with only one other thing to do: instead of outputting into a text file, we would output our data into the serial port and have the Arduino read the values from there. We ran into many obstacles in the process of implementing this, but the most prevalent problem was trying to circumvent the serial port only being able to process one program at a time. We were able to solve this by micro-managing the opening and closing of the serial ports, allowing for the programs to simultaneously write and read from the serial port.
Accomplishments that we're proud of
We are, first off, extremely proud that we managed to succeed in our original goal of creating a visual display of a fourier transformation. Apart from this, we had notable breakthroughs, such as generating the magnitude to frequency graph, transferring data from the C# program to the Arduino, and getting the LEDs to respond in the correct manner.
What we learned
How fourier transformations work, programming in C# and Arduino, micro-managing the serial port, using Wolfram Technologies, creating circuit structures, how to create real-time visual displays in C#
What's next for Fourier Audio Visualizer with White Noise Removal
We are hoping to scale this project to a bigger and better display board so we can visualize more complex sounds and implement a faster and more accurate fourier transformation.