reinventor

eChucK Spatializer Circuit

In eChucK, Music on July 25, 2011 at 6:33 am

An eChucK Lunetta Spatializer Circuit

We’ve all heard the sound effect of music wooshing from one side to the other, especially while listening with headphones.  Ever wonder how that’s done?  It’s easy:  just make the left channel signal amplitude reduce while the right increases.

Actually good spatialization as they call it requires a lot more fancy stuff that models the speed of sound in air as it travels from the sound source to your ears in two separate and unequal paths, but you can get pretty good results from just fading the signal amplitudes.  That’s what this circuit does.

I created this eChucK Spatializer circuit in software form first by programming it in ChucK, then imgineered it into hardware form using a 4000 series CMOS analog mux chip, the CD4052.  It provides four spatial positions:  left, left of center, right of center, and right.

What you do is you apply your music signal to the input buffer, then select the spatial position with the A and B input pins to control where the sound will appear to be.  It works by creating four voltages with a voltage divider made of three resistors, then multiplexing those voltages to the left and right channels.

The voltage divider provides voltages Vin, (2/3)*Vin, (1/3)*Vin, and 0*Vin.  We apply these four voltages to the four X channel inputs, then apply them in reverse to the Y channel inputs.  The result is output voltage pairs of (left, right) equal to (1, 0) or (2/3, 1/3) or (1/3, 2/3), or (0, 1) times Vin, thus crudely but effectively spatializing the monaural input signal on the stereo output channel.

If all those numbers just went wooshing over your head like a jet airplane, just think of it this way:  the digital control input selects the appropriate left and right channel signal levels to create the impression that the sound source exists at one of four places.  Changing the digital input value moves the perceived location of the sound to a new position each time.  So you connect time varying digital signals to the A and B inputs and you get sound bounding around inside your head (with headphones) or in front of you (with speakers).

To create that left-to-right motion effect, just put a two bit binary count into the inputs B and A, with B as the most significant bit and A as the least significant bit.  That way the left channel amplitude reduces while the right channel amplitude increases.  The sound will be stepped in four positions instead of smoothly changing, but hey what level of perfection do you expect from a humble logic chip?  Not a bad effort for the lowly mux, I’d say.  Well done little CMOS chip, you’ve earned soome well deserved electrons!   Now go forth and spatialize your audio.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: