Hi, i am working on a 3D LED-cube-like spectrum analyzer and have been having problems with the spectrum analyzer part.
I am using the Spark Fun Spectrum Shield, which contains the MSGEQ7 chip for spectrum analysis. This chip splits an audio spectrum into 7 equal bands:
63Hz
160Hz
400Hz
1kHz
2.5kHz
6.25kHz
16kHZ
My spectrum analyzer needs 16 bands, so I need a way to average the seven values outputted by this shield into 16. There is probably an easy mathematical way to do this, but I am relatively new to Arduino and in some cases, application of math.
Can someone show me a way I can do this! Any help is greatly appreciated! Thanks in advance!
That shield has 7 bands x 2 channels = 14 bands so that only leaves you with 2 unused channels on your spectrum analyzer. Maybe you could use those for some sort of cool light effects unrelated to the audio spectrum.
Well, I thought of that but the second chip is for the right audio channel, while the first is for the left. I am trying to make the analyzer mono, only using 1 audio, channel, so I need to stretch 7 numbers to 16.
I know it will not be that accurate but it will still represent the difference audio frequencies somewhat.
sterretje:
Of you want two bands in between, two times lower plus higher divide by three and one time lower plus two times higher divide by three.
MarkT:
But here simple linear or quadratic interpolation might be simpler and adequate.
Ok, i am going to modify the 3D LED-Cube-Spectrum analyzer to have 19 channels instead of 16, Since I have not finished building it, this will not take too much work
I am going to use the 19 channels in this way: (| represents a channel, 1 represents a real number from IC, the gaps between the 1's will be numbers averaged out in a linear way^)
| | | | | | | | | | | | | | | | | | |
1 1 1 1 1 1 1
I will post the finnished project when it is done, thanks to pert, sterretje and MartT for the help!