Hi, i need to make a spectrum analyzer for a project which is going to pick up the audio signal from a pre-amplified microphone, the output si an led matrix, but i want to be able to change the size of the matrix on the fly, so, i make only one board that would fit any matrix i want to use, so it must have a variable amount of channels, for doing so i was thinking about two options, the first one is to use 2 Microchip MCP4162-series 10k rheostat with two capacitors in order to create a low-pass and high-pass filter with each pair, so i can have a variable band-pass filter, by doing this i can use as many channels as i want by modifying the code, i just have to make the band-pass narrower and that's it, i read the value > change both resistances> wait a couple of microseconds > read the value again and so on, the other idea is to create several pre configured band pass filters in the pcb and reading each one at the same time with an analog input multiplexer, but i would have to make the pcb bigger it's inconvenient and it isn't as flexible as the first one, but it will work for sure. bottom-line what do you think? thanks
Using a sliding band pass filter is not a very good idea. This is because the band width of a filter will not be very fine or the filter will ring a lot. The only good way to do this is with a FFT from a sampled record of the input signal.
what's an fft? i'm not familiarized with audio processing, the system doesn't have to be extremely precise, because it is for a visual effect not for a professional audio equipment or something
FFT stands for Fast Fourier Transform and is a bunch of maths for splitting samples of a signal into its component frequencies.
Rggmiranda: the system doesn't have to be extremely precise, because it is for a visual effect not for a professional audio equipment or something
Well in that case, there are crude versions of FFTs which are commonly implemented in such displays - though I do not have any references to hand. Perhaps search on "FFT audio spectrograph algorithm".
There are numerous FFT libraries available through forum search (hint: FFT) and this will get you started http://dangerousprototypes.com/forum/viewtopic.php?f=56&t=1724
Before jumping into coding, waste a little time on YouTube (hint: search on FFT).
Here is another one. It uses a harting transform instead wich gives more effektive code