Copy Link
Add to Bookmark
Report

Building a DSP board, Part Three: Designing the Analog Filters

atari's profile picture
Published in 
atari
 · 3 years ago

This is the third in a series on how I went about building a dual Motorola DSP56000 sampling board.

Before we design the filters, let's figure out why we need them in the first place.

At first, I wasn't going to use anti-aliasing filters, as I thought most of my sources would naturally be bandlimited to 22.05 kHz, anyway. But, there's always the possibility of some stray video signals getting in there. The biggest factor, however, was that the SM5805 required a clock that was 256 times the sampling rate. Since I was going to be using 88.2 kHz, that meant I needed a clock rate of 22.5792 MHz. I couldn't find a crystal at this rate (I didn't look very hard - I'm sure they are available), so I decided to use the 20 MHz off the 56000. 20 MHz / 256 = 78125 Hz. This gives me an upper limit of 19531.25 Hz. No big deal for me, since I'm trying to do Dolby Surround off of VHS Hi-Fi or LaserDisc and movie and TV audio rarely gets up that high. But, that means I needed an input filter that starts cutting at about 19kHz.

The beauty of the double oversampling is that it allows me to move the 90dB point out to 0.75 * 78125 Hz = 58593.75 Hz, which is a heck of a lot easy to build in analog land than one that has a 90 dB point at 20kHz!

In my last post, I mentioned that you can use the same analog filter on the input as on the output. Why is this? Bear with me, as these graphs are difficult to draw in ASCII terminal land.

For the sake of argument, assume that your input signal contains every frequency imaginable:

 	+---------------------------------------- 
|
|
|
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

fs in these examples is the sampling frequency AFTER decimation

We pass it through our analog LP filter to get

 	+--------\ 
| -----\ (draw a straight line before 0.5 to before 1.5)
| ------\
| ------\
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Now we are bandlimited to 1.5*fs. Now, we sample at 2*fs and get the typical digital frequency repetition:

 	+--------\		       /--------+ 
| -----\ /-----
| --/---\--
| /------ ------\
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Gosh, that looks terrible. Can you make it out? Basically, they overlap between 0.5 and 1.5 (i.e., aliasing). Make those straight lines as in the previous example.

Now, we pass the above signal thru the killer digital filter:

  
+-------\ /-------+
| | |
| | |
| \ /
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

We've gotten rid of all of the aliasing noise. Next, we decimate:

  
+-------\ /-------+-------\ /-------+
| | | | |
| | | | |
| X X
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

So basically, the SM5805 allows us to build an analog filter with half the number of poles that we would need if we were to use no oversampling. Quite a big win.

Now, do we need to make a whole new design for the output (reconstruction) filter? No. Here's why:

Let's start with our digital signal coming out of the 56000:

  
+-------\ /-------+-------\ /-------+
| | | | |
| | | | |
| X X
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Now, the SM5805 interpolates the signal for us:

  
+-------\ /-------+
| | |
| | |
| \ /
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Note that we needn't filter the signal again, since it was already bandlimited. Next, we pass this thru the *same* analog filter we used at the input. Remember, its frequency response is:

  
+--------\
| -----\
| ------\
| ------\
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Here's our final output:

  
+-------\
| |
| |
| \
+---------+---------+---------+---------+
0 0.5 1.0 1.5 2.0 *fs

Hopefully, you've been able to follow this (I know it's tough with these lame ASCII graphics). I was going to post how to design the actual filter, but there are so many variations that I've decided to skip that for brevity. However, I do have some programs that will figure out what pole/zero combinations you need for Butterworth, Chebychev, Inv-Cheb, and Eliptical filters. Also, I have some for figuring out frequency response for various pole/zero combinations and a frequency domain version of SPICE that will figure out frequency responses for op-amp type filters. All of these programs were written for a class I took, and don't have much dox, but they are written in C and should run on any computer.
They are available via my archive server.

Oh, BTW, I chose Chebychev because it has no ripple in the passband and takes half as many poles as the Butterworth. Each complex pole pair can be done with one op-amp, so the fewer pairs, the better. However, we do have a phase problem. My Chebychev design has a phase lag of 180 degrees at 20kHz. The phase starts taking off at about 2kHz. This is no big deal for me, as I am dealing with yucky movie and TV signals, but for those hi-fi nuts who buy expensive cable and interconnects, this is bloody murder...

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT