Extract frequencies from PCM signal I have an PCM (pulse-code modulation) signal. If I want to work out the frequency of a sample $ x $ long, I count the number of peaks/troughs of the sample, and divide by $ x $. The equivent dB of frequencies $ 20Hz &gt; 20 000 Hz $ is then just the equivelent dB of the signal as a whole

However, I would like to create a spectrum analyzer of the type shown below. This requires extracting the equivelent decibels of different frequencies in the signal. So I need to split the signal into different signals of different frequencies, so I have signals of $ 20Hz &gt; 5000Hz $, $ 5000Hz &gt; 10000Hz $,  $ 10000Hz &gt; 20000 Hz $, ect.

How can I extract signals for the different frequencies from one master signal?
It is not clear if you want to visualize the signal or process/transform it ("graphic equalizer" is an effect/transformation adjusting the signal level independently in various frequency bands, not a visualization - a more correct term for the representation you posted an image of is "spectrum analyzer").

It is not clear if you are working in the analog domain or the digital domain, and what kind of technology you want to employ (analog electronics? computer code running on a DSP chip or microcontroller? on a desktop computer?).

Are your signals audio signals? In which case you have to be aware that a meaningful representation should display the 20 Hz .. 20kHz range (range of human hearing), and that it should be subdivided logarithmically.

To get this kind of visualization, there are two solutions:


A bunch of band-pass filters (and a low-pass + a high-pass for the lower and higher channels). You then measure the (log-) energy in each band to get the "height" of each bar. This can be done in the analog domain (a bunch of op-amps for the filter, a rectifier to measure the signal level, and a log-amplifier to get the energy on a log scale; or with dedicated ICs like the MSGEQ7); or in the digital domain with digital filters.
A FFT + some grouping of adjacent bins (which is more or less equivalent to computing the filter bank in the frequency domain). Note that this can only be used for digital signals.