It continues to be a full color dot matrix LED from last time.
In the previous article, we created an LED panel controller that makes it easy to display the full color dot matrix LED from the SPI, and created a video player using it.
However, the LED panel controller I created is not only for movie playback but also for full color dot matrix LED to be handled like SPI connected graphic display, so it is possible to use more general purpose.
So I decided to create an audio spectrum analyzer with Arduino nano with a full-color dot matrix LED of 64 * 32 pixels and LED panel controller this time.

When examined with Arduino and a spectrum analyzer, seven bands using MSGEQ 7 seem to be common.
However, in 7 bands, the dot matrix LED of horizontal 64 pixels can not be fully utilized.
In this case, we decided to take audio signal directly into Arduino and perform FFT inside Arduino.
First of all, 16 MHz ATmega 328p installed in Arduino is considerably heavy loading FFT in real time? I wonder if I can not get the performance I expected. Although I was worried about it, I was able to demonstrate satisfactory performance as a result by using the very fast FFT library described later.

I think that I will finally get into the content.
Anyway, first of all it is hardware.
I wrote that I’ve taken the audio signal directly into Arduino earlier, but in strict this is an error.
It is a well-known fact that the voltage range that can be input to Arduino is in the range of 0 [V] to 5 [V], but the voltage range of the audio signal output from the earphone terminal of the personal computer etc. is -0.447 [ V] to 0.447 [V]. (It comes from the point where the general line level is -10 dBV, but it may be wrong.)
That is, the voltage is swinging to the minus side, too, the amplitude is too small Directly to Arduino Audio signal can not be input.
Therefore, in this circuit, first, the voltage is pulled up by 2.5 [V], which is half the voltage of 5 [V], and then it is input to the analog pin of Arduino after passing through the amplifier circuit to increase the amplitude It is configured.
The circuit diagram is shown below. ① Midpoint potential superimposing / noninverting amplifier circuits X1 and X2 are stereo mini jacks. Since it is simply connected in parallel, it can be either input or output. As you can see, it only captures one of the stereo audio signals. Well it’s a charming thing …”