Spectrum analyser Equalizer project how to go about it?

Maglatron

Jul 12, 2023
257
I think this method is more pactical for me I need it explaining though so the actual name for the 7459 is 74HC595 and it's a shift reigister I want to know how to utilise 6 of them, 3 for the x axis 24 bands and 3 for the y axis 20 for a total of 480 LED's so there will be 6 74HC595 chips. I know I have changed it again but I want to make use of the full 500 LED's and I want to incorpoate it with the esp32 arduino! and shift regiters and decade counters

Last edited:

Maglatron

Jul 12, 2023
257
I am going to have a esp32 nano. I want to build a Led matrix of 480 leds 24bands/columns/channels and 20 in each row. I will be using 74HC595's, 3 for the columns (thats 24) and 3 for the rows (24 but i'm using 20) there are 20 rows the columns are updated each 60hz so across the set of 24 there will be 1440 pulses of the column cycling frequency and updating the amplitude (how many led's it lights in the y direction) and each bar is represented by 3 decibals. 25 times per second for each band. I am using two RCA jacks (white and red) I do not want arduino code at this point . are you following so far. Frequency Band Analysis: This could be done using an FFT I need to calculate the amplitude of each band I want the bands on the left to be low and basey 32hz and the high pitch to be 16khz

Martaine2005

May 12, 2015
4,675
Sounds like a good plan.
Let us know how you get on.

Jul 12, 2023
257
Yes I will do.

Maglatron

Jul 12, 2023
257
building an LED spectrum visualizer using a LED matrix. You want to use 74HC595 shift registers to manage the rows and columns, and the data should correspond to frequency bands extracted from an audio signal. Let's break it down step-by-step:

1. LED Matrix Setup:
• Your matrix consists of 24 columns and 20 rows, totaling 480 LEDs.
• 3 daisy-chained 74HC595s will control columns and another 3 will control rows.
2. 74HC595 Control:
• The shift registers will be connected in series, with the Q7S (serial out) of one connected to the DS (serial in) of the next.
• Columns: Each bit in a shift register will control one column. For this, you'd use transistors as switches for each column since the 74HC595 cannot source/sink enough current for multiple LEDs.
• Rows: Similarly, each bit in the row's shift registers will control one row. Depending on the common type of your LEDs (common cathode or common anode), the rows might be sourcing or sinking current.
3. Frequency Band Analysis:
• You'll need to perform a Fast Fourier Transform (FFT) on your audio signal to extract the amplitudes of various frequency bands.
• Your interest lies in the bands from 32Hz to 16kHz. This will likely involve averaging or summing groups of frequency bins from the FFT to get the desired bands.
4. Sampling Audio:
• Using the ADC pin on the ESP32, you'll sample the audio signal. If you're using an RCA jack, you need a simple resistor divider or operational amplifier circuit to step down the audio line level to the range readable by the ESP32's ADC (0-3.3V). Also, make sure the input signal is biased around 1.65V (half of 3.3V) since audio is AC, and the ESP32 can't read negative voltages.
• Pink noise is equal power in bands that are an octave wide. It has more low-frequency components than white noise. If you use pink noise, it can give a more uniform response across your bands, useful for testing.
5. Potentiometer for Gain Control:
• Incorporate a potentiometer to allow adjustment of the ADC input's sensitivity. This can help visualize quieter audio sources. It acts as a gain control, making quieter signals appear louder on the matrix.
6. Timing:
• Columns are updated 60 times a second for each, resulting in 1440 updates across all 24 columns every second.
• For the rows, the amplitude data updates 25 times a second for each band, meaning every 40ms. But with your latest specification, you need the amplitude data to update synchronously with the column, 1440 times a second, or roughly every 0.694ms.
7. Visualization Mechanics:
• For each column update (which happens very rapidly):
1. Turn off the previous column.
2. Load the next column's bit into the column shift register and the corresponding amplitude data into the row shift register.
3. Turn on the current column's LEDs based on the amplitude data.
• The process repeats for all columns in a continuous cycle.
Given the high update rate required, the ESP32's dual-core functionality can come in handy, allowing simultaneous processing of audio data on one core while managing LED updates on the other.

However, a word of caution: Depending on the FFT library's efficiency and the chosen FFT size, achieving real-time frequency analysis at such high update rates might be computationally intense for the ESP32. Optimization and efficient coding practices will be crucial.

Can I update the amplitudes with the FFTlibrary fast enouth to get a sample within 0.694ms

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,337
Can I update the amplitudes with the FFTlibrary fast enouth to get a sample within 0.694ms
I don't know. Run a test to find out.

But why such a fast update rate? Given that the human eye can accept 25 frames per second as video, an update rate of 40 ms (1/25 second) should be good enough for a visually pleasing display. If that's not good enough for you, how about 20 ms? Twice as fast and much faster than your eyes can follow.

Maglatron

Jul 12, 2023
257
ok so the thing i was looking at says that each of the columns need to be flashed at 60 hz and 1 columb is on one at a time ther're 24 columns so that equal 1440 pulses in a second but if you're say that the update rate of each led in the columns need to only be 25hz then that equal 600 pulses per second (going through the 24 columns)

Last edited:

Maglatron

Jul 12, 2023
257
the problem I have is that when each column is is on I need the rows to correspond to the column that is on for example if column 17 is on and the decibels (amplitude) is say 12 decibel (3 decibels per led upward) 4 leds on then when it clicks over to 18 that might have only 9 decibels lighting 3 leds how do you keep the amplitude updates in time with the columns going across, hope this is not too complicated but I'm trying to explain the best I can I want the amplitude of the correct frequency at a time only

Maglatron

Jul 12, 2023
257
ok so I'm confused how do you map the frequencies to the columns and have the amplitude update every time the column moves to the next in line
I'm thinking of wiring up the leds in the configuration of ws2812b wiring diagram is it transposable to my led matrix

Maglatron

Jul 12, 2023
257
so say the cycling is 24 columns each for 25hz then 600 pulses each light will be on for 1/600 = 1.67milliseconds and I want to display the amplitude for this column each time the light is on gives me 1.67 second to process and display the leds which is pretty tight and the lights won't be on for long, I'm sure there is a more efficient way of doing this. help needed?

Maglatron

Jul 12, 2023
257
essentially I want this but I want 24 columns and 20 rows, but he didn't upload the code!!

Maglatron

Jul 12, 2023
257
I found the code it uses

WS2812 LED panel​

can it be adapted to work with my 24 column 20 row (where the anodes are connected down the columns and the cathodes across the rows) the frequency goes from 32hz to 16khz logarithmically going from 32, 37.72, 44.5, 52.49, 61.96, 73.15, 86.35, 101.92, 120.22, 141.65, 167.01, 197, 231.49, 271.48, 318.23, 373.12, 437.88 515.5, 609.39, 722.35, 857.56, 1015.84, 1199.54, 16000 in Hz

Attachments

• esp32_spectrum_analyzer_32x16.ino
17.6 KB · Views: 0

bertus

Moderator
Nov 8, 2019
3,034
Hello,

There must be a failure in your frequency list.
You jump from 1199 to 16000.
What happens to the frequencies in between?

Bertus

Maglatron

Jul 12, 2023
257
not sure il work it out again does anybody have a .zip file for the esp32 because my internet does not allow me to download and add

Maglatron

Jul 12, 2023
257
ok how would you split the columbs from 32 on the left an 16000 on the left evenly spaced in between

Maglatron

Jul 12, 2023
257
perhaps these numbers are better

1. 41.5 Hz
2. 53.8 Hz
3. 69.8 Hz
4. 90.5 Hz
5. 117 Hz
6. 151 Hz
7. 196 Hz
8. 253 Hz
9. 328 Hz
10. 424 Hz
11. 549 Hz
12. 710 Hz
13. 917 Hz
14. 1186 Hz
15. 1532 Hz
16. 1980 Hz
17. 2559 Hz
18. 3306 Hz
19. 4265 Hz
20. 5489 Hz
21. 7050 Hz
22. 9032 Hz
23. 11631 Hz
24. 14955 Hz

Maglatron

Jul 12, 2023
257
Okay so I found this!
how do I add it to the arduino IDE? thanks

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,337
You know how to use a search engine?

Maglatron

Jul 12, 2023
257
I have tried that it doesn't work

Replies
4
Views
8K
Replies
12
Views
5K
Replies
0
Views
3K
G
Replies
1
Views
1K
Michael A. Terrell
M
G
Replies
0
Views
916
Graham
G