Maker Pro
Maker Pro

Spectrum analyser Equalizer project how to go about it?

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,461
Joined
Nov 17, 2011
Messages
13,461
FFT (Fast Fourier Transform) is a mathematical tool to analyze the spectrum of a signal in the digital domain It delivers the relative amplitude of each frequency band within the spectrum.
Using filters (be it analog or digital) can deliver an equivalent output. But you need one filter for each frequency band (aka channel).

The difference here is that the FFT takes a number of samples (e.g. 1024) and computes the spectrum from these samples whereas the filters work all in parallel and you get an updated output with every sample.
Thus FFT involves a certain latency (aka delay) between the input and the output of the FFT whereas the filter approach works (almost) instantaneously.

Assuming 1024 samples for each FFT pass and a sampling rate of 44 kHz, you get an output from the FFT approx. every 25 ms:
[math]gain = \frac{1024 samples}{44000 \frac{samples}{second}}= 23.27 ms[/math]This should be good enough for an LED display.
However, the number of output bands (aka channels) is 1/2 times the number of samples, in this example the FFT from 1024 sampoles would give 512 bands. You could combine multiple bands into one (simply add the outputs from the FFT) or reduce the number of samples. But the number of samples should be a power of 2. The nearest power of 2 in your case id 64 which leads to 32 bands...

@Maglatron : Please don't be offended, but:
I dare say that if you have to ask about the difference between filters and FFT this tool is much too advanced for your current level of understanding.
You'll be imho best off following one of the many complete instructions for LED spectrum analyzers that you can find on the internet.
Or start with a DIY kit like e.g. this one.
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
I tried to route the array in in PSOC chip, using its LED array driver component (remember a "component" is
a onchip resource in PSOC discussions). That component is limited to 8 x 24 so array has to be driven by
two components (all onchip) :

View attachment 60551
You would need NPN transistor for each column to handle the 31 LED amount of potential
current into it. Note PSOC is limited to on segment current, q00 mA per port of 8 pins.


Difference between filter and FFT :

Filter we need a filter solution for each channel (frequency) and can only do 2 / PSOC
chip.

FFT we take a bunch of sampels, then run the FFT ananlysis on the sample set, Its comuptationally
intensive, large latency = lower update rate of display, but I think doable. This is a test you would
\clearly work out, resolution of FFT in frequency versus update rate, its a tradeoff. I am not expert here,
learning myself, but have downloaded and compiled a FFT example project.

I think preferred method here is FFT by far, just have to test out / code actual set of freqs.


Regards, Dana.
do you mean 100mA?
How do you go about testing out / coding the set of frequencies will that chip?

https://www.ebay.co.uk/itm/36438758...yxQRwJAvqFLDySBQzgqsCCbnV3SE|tkp:BFBMgPjz_Mhi

Does this chip still suffice, or do I need a chip with more I/O pins?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,461
Joined
Nov 17, 2011
Messages
13,461
the analog one has the ability to add more frequency easily
It strongly depends on your definition of "easily".
When you change the number of bands, you also have to change the center frequency and the bandwidth of each band. This requires a lot of computation and a lot och changing of components.

In the digital domain you change a few parameters and voilá.

Of course, you could also implement the filters as digital filters to gain advantage of the comparatively easy change of parameters. But designing and dimensioning digital filters also requires a thorough understanding of these beasts.
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
understood perhaps biting off more than I can chew at the moment. essentially I want to make the LED matrix to respond to music not really too bothered how I achieve it, but I am able to learn. I want the frequencies from red and white rca jacks. there are 30 leds up by 15 leds wide. what in your opinion do you think I could do to get the results needed
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
I have a book on fourier transforms and the entire book is way over my head
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
I'm very exited about that project harald, are there any projects that include the more of the LED's that I want
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
and I appreciate the fact that at the moment I don't have the skills or experience as of yet but I enjoy learning!!!
 
Last edited:

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
But for proto purposes the 059 board will do to implement fewer columns for test is this for the FFT aproach or filter approach?

Filter just 2 channels. FFT you would have to look at manual/pinout to see how many
pins left after implementing 31 segment pins and A/D input pin and DAC output pin.
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
Driving an array of LEDs :

1693576074554.png

The NPNs for column drive can handle all the segment current, which a typical processor cant.
Here PNPs were also used in case one wants LED current >=~ 20 mA in the LED. And you see
the current limiting R in series with the LED to insure it does not get burned out from too much
current.


Regards, Dana.
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673

To do whole design you need 15 + 31 pins + say 5 pins for misc. That board does not have enough pins.
The alternative board is CY8CKIT-050 which is a lot pricer, or get a chip and do a layout....

1693576528040.png


Regards, Dana.
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
ok so going back to the analog version and comparing with the FFT digital version, the analog one has the ability to add more frequency easily but the overlap because of bandwidth and this gives a smooth transition between bars and the FFT cypress version, you program the frequencies in, but need to have more computational power and it has a slower responce time. ok so now once it's ringing the correct bar how do you control the hight of the bars, and you mentioned that I'll have to make use of transistors aswell can you explain more about that please?
What does "onchip" mean

Filter case : It can be overlapping or non overlapping, depends how you configure it. The examples
I showed are very narrow band, high Q filter solution, so effectively non overlapping.

A FFT has a problem in that at each freq bin that it generates its very narrow band, very precise.
Sp when one looks at output it looks like :

1693577354955.png

So to get around that one can interpolate the adjacent bins and the bin being looked at
and use that when controlling the LED. Or use "windows" which I wont get into now.

Notice the spectra has a height. FFT produces that, via a pair of complex numbers.
That height is the strength of that freq bin. So one takes the sqrt(sum of squares)
of these complex values to get the Hight.

Regards, Dana.
 
Last edited:

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
I'll explain again, I need to create a matrix consisting of LED's (16 bands or (channels)) 50 x 10 segment digital Red Bar Graph display there will be 2 left over . And then 30 high or "up"

this doesnt seem to have more pins than that which you posted - then the thin one also how do you drive the rows and columns with the micro controller
I also want relatively slow decay as the bars drop down!

 
Last edited:

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
so there are 140 pins on the CY8CKIT-050 availabe given that some are for power and wotnot I want effectivly 450 LED's how does the light bar go up with decibels is it because the transistors act as valves
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
You keep changing the specs of x and y of the display ? So now you want 50 frequencies and 10 segments / frequency,
so you need for the matrix 10 rows x 50 freqs or 60 pins.


That board has a lot more pinout than the 059 board....its manual :
so there are 140 pins on the CY8CKIT-050 availabe given that some are for power and wotnot I want effectivly 450 LED's how does the light bar go up with decibels is it because the transistors act as valves

The board pins available are sections 4.2.6 The # pins much less than 150.
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
I think before you go any further you need to work with basic board, part, and IDE,
to start getting a feel.

Just a thought. So try a reduced solution first to see what you can accomplish and
then migrate to the bigger board.


Regards, Dana.
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
good idea
Filter just 2 channels. FFT you would have to look at manual/pinout to see how many
pins left after implementing 31 segment pins and A/D input pin and DAC output pin.

You keep changing the specs of x and y of the display ? So now you want 50 frequencies and 10 segments / frequency,
so you need for the matrix 10 rows x 50 freqs or 60 pins.


That board has a lot more pinout than the 059 board....its manual :


The board pins available are sections 4.2.6 The # pins much less than 150.
right so you misunderstood I'm buying 50 of these - I want them to follow music with deep frequencies on the left and high pitch frequencies on the right I want them to run off of the signal from a RED RCA and WHITE RCA
https://www.ebay.co.uk/itm/191750934970 -
and am having them vertical for a total of 30 LED's high (because they are sets of 10) and am having 16 columbs like picture attached. So there will be a grand total of 180 LED's in the matrix - look at the picture! I'm not too fussy about how to achieve this but all suggestions are welcome! Thanks.
 

Attachments

  • matrix led.png
    matrix led.png
    698.5 KB · Views: 1

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
the pins are doubled up theres 40 on the right and 40 on the left yep your right theres 80pins in total so probably 65 usable pins
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
Would I be able to drive the matrix with the fast fourier transform (FFT) with the CY8CKIT-050? does it have enough pins? I will also buy the 059. I don't mind buying additional parts and pieces because they always come in handy at some point. I understand that I don't have any experience with cypress but I have to start somewhere, so it was nice that a scematic was drawn for the 16 LED's, if you have the time can you make a diagram with the 180 LED's? probably a longshot but if you don't ask you don't get! thanks
 

Maglatron

Jul 12, 2023
570
Joined
Jul 12, 2023
Messages
570
with the arduino I just bought a few and started messing about with it now I'd say I'm quite competant so thats what I will do with the PSoC and cypress, I have the ability to learn and when I asked about filter approach and FFT approach, it needed asking at some point because that's how to learn!
 

danadak

Feb 19, 2021
673
Joined
Feb 19, 2021
Messages
673
Would I be able to drive the matrix with the fast fourier transform (FFT) with the CY8CKIT-050? does it have enough pins? I will also buy the 059. I don't mind buying additional parts and pieces because they always come in handy at some point. I understand that I don't have any experience with cypress but I have to start somewhere, so it was nice that a scematic was drawn for the 16 LED's, if you have the time can you make a diagram with the 180 LED's? probably a longshot but if you don't ask you don't get! thanks

The forum encourages users after they have made basic attempts at doing thins. So I am going
to decline to make your drawings. So take small bites,. use an online tool for drawing schematics,
tackle a drawing for 1 column, and ask for comment.

Regards, Dana
 
Top