The construction of a spectrum analyzer is somewhat complicated, but if one is satisfied with a limited number of analysis bands, the system is not necessarily very complex to implement. Instead of using a sliding filter or a processor to ensure Fourier decomposition, it is possible to use several simple (analog) bandpass filters at the same time, each filter working individually. By adopting this method, a 10-band (octave) or even 30-band (one-third-octave) spectrum analyzer can be manufactured on its own, with a minimum of patience and components. Under these conditions, some bars of LEDs mounted in a VU meter make it possible to produce “lines” of variable amplitude, according to the spectral components detected in the analyzed signal. This type of device can accomplish very different missions:
– measurement of the frequency response of audio equipment or listening room, by associating a noise generator and a microphone (the most linear possible);
– impress his guests, acting as a beautiful gadget.
The following discussion is about an audio-specific ten or 16-band LED spectrum analyzer that uses “discrete” filters.
- For this project, we use a mega Arduino, although it can also be done with other Arduino models such as Arduino Uno or Arduino nano.
- These RGB LED modules use a type of smart led ws2812, each led has a programmable circuit incorporated in its package that communicates with the microcontroller through a single data pin, which in turn has an output pin that retransmits the information to the next LED so that LEDs can be connected in a chain and with a single cable to control many LEDs.
- The module we use comes in the form of an array of 8 × 8 LEDs, all the LEDs are mounted on a plate, but they are also available in the way of flexible LED strips, in the form of rings, rigid pieces, etc.
- These modules have six pins, which are separated into two groups in one we have VDD (of 5volts) GND (negative or mass) and DIN (data entry).
- On the other hand, we have VDD (output of 5volts), GND (negative or mass) and DOUT (data output), these last 3 serve to be able to chain another module easily and thus get a more massive matrix, and we can continue using a single pin to control the 128 leads.
- To control this type of module with Arduino, we have the Neopixel and FastLed libraries that make our work easier.
- But we will not go into details, and in future posts, we will see well the subject of its programming.
- Now we go directly to the assembly of our RGB Spectrum Analyzer, for this, we will need an Arduino, two stereo jacks, three resistors, the RGB LED Matiz module and a 5-volt power supply to power the module externally. Its consumption could be higher than those that the internal Arduino regulator can support.
- As you can see, the circuit is straightforward, we use an analog pin the A7 of Arduino to take the music, and through the resistors, we adopt the audio signal to be according to what the microcontroller can handle.
- For the program to work correctly before compiling or loading the sketch, we will need to download and install these two libraries.
- These two libraries should be precisely these, not other versions since otherwise, the program will not work, for its installation unzip the two files in the Libraries folder of the Arduino side.
- We load the Sketch in Arduino; we assemble the circuit, we connect the audio output of our cell phone or from some pc and the other jack, we link to some sound system or speaker and go.
Basic principle: filtering
It consists of using a BF filter for each audio band that you want to analyze. The filters are of the band-pass type, except for those concerning the low end of the spectrum and the high end of the spectrum, which can be respectively of low-pass and high-pass type (this being said they could also be of the band-pass kind). All filter inputs are connected in parallel, and each filter receives the entire audio spectrum. It is only at the output of the filters that we have “spectrum slices.” The first filter (low-pass type) has a cutoff frequency of 32 Hz, and anything above this frequency is significantly attenuated. The second filter (band-pass sort), works with a central wavelength of 64 Hz, with a bandwidth of a few tens of Hz. The third filter (band-pass type), works with a fundamental frequency of 125 Hz, with a bandwidth of a few tens of Hz. Each filter is thus entrusted with the task of letting only part of the sound spectrum pass through, each with a bandwidth that allows band overlap, moderate but sufficient. See, for example, the page filter BF 009.
The output of each filter provides a signal BF, which includes only the spectral components that the filter wants to pass, and is directly followed by a rectifier that produces a DC voltage whose amplitude is proportional to the magnitude of the AC signal. Present at the output of the filter. This step is necessary to allow the display of a level on an LED scale, either as a bar or as a point. All rectifiers (there are as many as there are filters) are the same. See, for example, pages Rectifier diameter 004 and Modulator light 006.
LED display VU meter style
At the output of the rectifiers, DC voltages are directly exploitable to drive VU meter circuits. For ten filters and ten rectifiers, we need ten identical meters. Whether you use a meter consisting of AOP or a specialized course such as the LM3915, it is still trendy and is quite expensive to manufacture. One trick, to limit the total number of components, is to use a single meter instead of ten, and to very quickly switch the input of this single meter to the output of each filter, one after the other. It must be done quickly enough that the eye is not aware of anything, but the minimum speed to adopt can easily be supported by conventional and economic components (in practice, a switching frequency of the order of 1 kHz to 10 kHz is amply sufficient). Each column of LEDs, which represents a given spectral band, thus lights up only once in ten periods. If we work in bar mode, we will have a maximum of 10 LEDs lit at a time. And if you work in point mode, only one LED can be burned at any time, which allows considering a battery power.
Note: For this type of application, the use of a multiplexed LED driver (UAA170 or UAA180, 012 meters) cannot be suitable. All LED outputs must be individual. The use of a microcontroller PIC type can also be considered, again, if no multiplexing is implemented because multiplexing an already multiplexed circuit is rather complicated!
Number of bands
The number of analysis bands is here 10, but the circuits used to allow a natural extension to 16 bands. An analog multiplexer of the “4 to 16” type is used, which has 16 switching channels, only one of which can be active at a time (it depends on the value of a 4-bit binary coded word). ). To learn about this kind of editing, we can also limit ourselves to 5 bands …
The central frequency of the filters
There are central frequency values of filters commonly used in audio spectrum analyzers as well as in equalizers of the same domain. These values are as follows:
For an octave / 10 band analysis (doubled frequency at each hop up the spectrum):
31 – 63 – 125 – 250 – 500 – 1000 – 2000 – 4000 – 8000 – 16000
For one-third-octave / 30-band band analysis (frequency doubled every three hops up the spectrum):
25 – 31 – 40 – 50 – 63 – 80 – 100 – 125 – 160 – 200 –
250 – 315 – 400 – 500 – 630 – 800 – 1000 – 1250 – 1600 – 2000 –
2500 – 3150 – 4000 – 5000 – 6300 – 8000 – 10000 – 12500 – 16000 – 20000