Like many people I listen to music on an mp3 player about the size of a matchbox but one-third as thick. This player features a basic graphic equalizer. It only covers about 6 bands but works surprisingly well in tayloring the sound to my ageing earholes. The question is, how is audio filtering implemented in something so tiny? To me, an audio filter (the ones I grew up with anyway) is typically the size of a cigarette pack at least and weigh several ounces and yet when I take the back of my player there's nothing in there bigger than a grain of salt (aside from the controller chip etc, of course). This seems to defy the laws of physics. How's it done?
Electronic components (and the signal levels they handle) can be arbitrarily small, until thermal noise ruins the SNR too much.
But even more likely, it's all done on a grain-of-sand DSP chip. It's a horrendously inefficient way to do it, requiring millions of transistors. But when the transistors are under 200nm across, who cares? As a bonus, the power consumption is less than the power amplifier (as in, an amplifier powering headphones).
Still none the wiser here. In order to function as a graphic equalizer, there must be some sort of filtering to enable the source signal to be split up by frequency so each band can be independently attenuated. If this isn't done with caps, coils and resistors (which it clearly isn't) then by what ingenious and mysterious sourcery is it accomplished, precisely?
Numerical filters typically work by calculating the weighted sum of a lot of samples flowing through a digital delay line. You can tailor the frequency response any way you like by choosing the right weights. The magic, of course, resides in the way to derive these weights from the desired frequency response.
DSP = Digital Signal Processing. Numerically. In software. On a digital processor. You can do all the filtering on the data stream before you turn it into analog.
Google the term. Usually I send people to Wikipedia for things like this, but a quick scan of their article doesn't leave me happy -- here it is, none the less:
formatting link
--
Tim Wescott
Control systems, embedded software and circuit design
I'm looking for work! See my website if you're interested
http://www.wescottdesign.com
The ingenious and mysterious sourcery is known as Digital Signal Processing (DSP) While not a DSP expert I don't find it hard to see that if you can do the necessary calculations in the necessary time with a processor chip running some software then you can do whatever equalisation you want. No-one does such things with caps and coils any more unless power handling is required or there is too much power behind the signal or the frequency is just too high for DSP. Signal processing is best done digitally for many reasons. Some have already been pointed out. Others are that you don't have any component tolerances or non ideal component behaviour to worry about. Inductors and capacitors can be less than ideal for signal processing for various reasons depending on various things such as frequency.
Symmetrical FIR filters also have perfectly flat phase, which is super-useful sometimes.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
hobbs at electrooptical dot net
http://electrooptical.net
Symmetrical FIR filters also have perfectly flat delay, which is super-useful sometimes.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
hobbs at electrooptical dot net
http://electrooptical.net
That was already done, when the music signal was encoded into MP3 format. This was done by what amounts to a Fast Fourier Transform, which converts a group of audio samples (time-domain) into a set of "frequency and phase and amplitude" samples (frequency domain).
These frequency-and-amplitude samples are then selected, quantized, and packed together. The MP3 format saves space (compared to a "raw" recording of the audio samples) by discarding those frequency samples with an amplitude too low to hear, and quantizing the amplitudes of the rest down to a smaller number of bits.
The MP3 player performs the reverse steps in order to recreate the audio samples: it unpacks the samples that were present, expands the quantized values out to full-range, "zeros out" the amplitudes of any frequency samples not present, and then does an inverse Fourier transform to recreate an approximation of the original audio waveform.
It's almost trivial to apply a "graphic equalizer" function during this reconstruction process. After unpacking the data, and before doing the inverse FFT, just multiply each "amplitude" value by the equalization constant that's appropriate for its frequency. This multiplication is of course done digitally, and it adds only a small amount or mathematical overhead to the computing that's done for the inverse FFT.
So, for most purposes, you can think of the equalization as being "free".
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
hobbs at electrooptical dot net
http://electrooptical.net
Ahh... So I googled "difference between IIR and FIR filter" and got confused. Some bad hits but these were OK...
formatting link
formatting link
(I wish they would show the response in the time domain too!)
So my only real exposure to digital filters was at a trade show, things were slow and I went over to the SRS booth to talk and play with their stuff. The one guy was showing off the new lockin (I think) and it could do different types of filters... both mimicking analog filters and full digital ones.
So what struck me the most was the low pass step response... with enough Q to give a little "ringing". I know what this looks like for analog filters, the digital one showed both pre- and post ringing. (I just made up pre and post ringing, but I hope you know what I mean.) As well as a steeper slope in the transition region. Must these have been FIR filters?
George H. (This is in no way important to anything I'm doing now... just curious.)
Well, you _could_ make an IIR filter with pre-ringing, if you really wanted to. I'm pretty sure it requires a non-minimum-phase filter. But in a DSP, if you see pre-ringing it probably means that there's an FIR filter in the mix.
(I think that the old LC analog delay lines in scopes would show pre- ringing. Not sure though...)
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
I'm looking for work -- see my website!
Probably. Some IIR ones have it as well--for instance, if you take a windowed sinc function lowpass and follow it with a running sum (which is a simple IIR approximation to an integrator) you'll still see the ripples in front.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
hobbs at electrooptical dot net
http://electrooptical.net
Sure, and that matters in closed-loop systems. I use a fair number of symmetric FIR filters because their phase and settling properties are terrific.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
hobbs at electrooptical dot net
http://electrooptical.net
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.