Digital Signal Processing Introduction – Digital Filters

  • A Digital Filter is used to modify a digital signal by passing certain frequencies and attenuating others.
  • This Digital Signal might come from an Analog to Digital converter. It might also be generated by a computer.
  • The range of frequencies that pass through the filter without attenuation is called the passband.
  • A filter that attenuates high frequencies is called low pass. What does a high pass filter do? Bandpass?
  • BandPass Filter Demo:

  • CD quality audio is low pass filtered to 20 KHz. Why?
  • Telephone signals are low pass filtered to 3.3 KHz. Why?
  • Your stereo’s bass and treble knobs control the volume of the built-in low pass and high pass filter outputs before they are added back together.

Digital Filters

  • There are many typesof Digital Filters. In this class, we will use FIR (Finite Impulse Response) Linear Phase (constant delay) filters.
  • One way to implement a Digital Filter is to multiply the Filter Frequency Response (FrequencyDomain graph, green trace) and the Fourier Transform of the input (FrequencyDomain graph, white trace). Then take the inverse Fourier Transform of the result.
  • The Inverse Fourier Transform of the Filter Frequency Response is called the Impulse Response of the filter.
  • A more common way to implement a Digital Filter is to convolve the input (TimeDomain graph, white trace) with the Impulse Response of the Filter. (Multiplication in the FrequencyDomain is equivalent to Convolution in the Time Domain for a Linear Time Invariant system,)
  • Use a tool like LPFDesign or BPFDesign (installed on the Urbauer 115 computers) to generate the Impulse Response for your filter constraints (shown in the text boxes above).
  • Question: What operation do Digital Signal Processors (DSPs) do better than traditional microprocessors?

Convolution

  • So, if x[n] is the input to the filter, h[n] is the impulse response, and y[n] is the output of the filter,

For h(white),x(red) and y(green) shown below:

So, for example

In other words,

  • Reverse h in time around 0.
  • y[n] is the dot product of x and the reversed h with h[0] at point n.
  • This low pass filter shown above is called a moving average or a sinc filter.
  • Note the delay of the filter (N-1)/2 = 2 samples where N is the length of the Impulse Response.
  • The elements of the Impulse Responseare often called Taps or the Filter Coefficients.

Fractional Arithmetic

  • Typically, the filter coefficients are expressed as numbers from -1 to 1.
  • To solve this problem, use 2’s complement, fixed point representation with the binary point between the MSB (sign bit) and the next most significant digit. In a 16 bit system, this is called 1.15 or Q-15. For example,

0.110 0000 0000 0000 = 0+2-1+2-2= 0.75

1.110 0000 0000 0000 = -20+2-1+2-2= -0.25

0.111 0000 0000 0000 = 0+2-1+2-2+2-3 =0.875

1.111 0000 0000 0000 = -20+2-1 +2-2+2-3 = -1+0.875=-0.125

  • The product of two 1.15 numbers will be 2.30.For example:

0.75 * 0.875 = 0.65625

In 1.15,

0.110 0000 0000 0000

x 0.111 0000 0000 0000

______

0110000000000 000000000000000

+ 0 1100000000000 000000000000000

+ 01 1000000000000 000000000000000

______

00.10 1010000000000 000000000000000

=2-1+ 2-3 + 2-5

= 0.5+0.125+0.03125=0.65625

  • To convert a floating point number to fractional (1.15), multiply the floating point number by 32768. For example,

-0.125*32768 = -4096(16.0) = 0xf000 = 1.111 0000 0000 0000(1.15)

0.875*32768 = 28672(16.0) = 0x7000 = 0.111 0000 0000 0000(1.15)

C:\HomeOnLaptop\cse465\Lectures\Lecture 3 - DSP Introduction-1.doc

Page 1 of 4