Linux command-line streaming vuvuzela filter

Like everyone else on the frigin' planet, I've been watching the World Cup and going insane listening to the vuvuzela horns. There's been a couple articles lately about how to filter out the sounds - first this German article using a Mac and then this other article about how to do it using JACK and QJackCtl.

I didn't feel like installing anything overly complex on my Ubuntu box and figured it *must* be possible to do using just the basic sound tools that come with Linux. It took me a little while, but using SoX (Sound eXchange) I was able to pipe sound from the default recording device (my laptop's mic/line-in), filter it, and then stream it immediately through the speakers. (Just apt-get sox if you don't have it on your box already).

Here's the command:

rec -d vol .5 equalizer 233 .1o -48 equalizer 466 .03o -48 equalizer 932 .02o -48 equalizer 1864 .2o -24 | play -

[Update: Yusuf Kaka responded in a post with a much more accurate set of arguments.:

rec -d | play -d vol 0.9 bandreject 116.56 3.4q bandreject 233.12 3.4q bandreject 466.24 3.4q bandreject 932.48 3.4q bandreject 1864 3.4q

Very cool!]

Now, it seems to work, but after listening to it over and over again, I'm starting to wonder how much of a real difference it makes. In theory, it should be completely filtering out those frequencies (233Hz, 466Hz, 932Hz, and 1864Hz) at various bandwidths. In practice it sounds more like it's dulling those frequencies rather than removing them all together - you can still hear horn blasts - but you can hear the crowd and whistles as well.

rec and play just call the main sox binary, so you can use the same params to play back a sound file. For testing, I recorded a bit of the Italy/Paraguay match into a .wav file using rec, and then used play like this to test the various filter settings:

play -v .5 gamesound.wav equalizer 233 .1o -48 equalizer 466 .03o -48 equalizer 932 .02o -48 equalizer 1864 .2o -24

The main problem is that I'm just copying stuff I see on other sites, and not really technically understanding how audio works at all. What's bandwidth? Gain? What does it mean by clipping? And who the hell is Butterworth?

Anyways, the command above is definitely filtering the sound, but I feel like it could be doing it *more*, I just can't figure out which numbers to tweak. If you have some ideas, email or send me a tweet!

:-)

-Russ

< Previous         Next >