Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002.

Similar presentations


Presentation on theme: "Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002."— Presentation transcript:

1 Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002

2 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher2 Sampling and Reconstruction Need to understand relationship between a continuous-time signal f(t) and a discrete- time (sampled) signal f(kT), where T is the time between samples (T=1/f s )

3 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher3 Sampling (cont.) After some manipulation, can show:

4 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher4 Sampling Effects: Frequency Domain X c (j  )  NN -N-N X S (j  )  NN -N-N SS -S-S 2S2S -2  S  SS -S-S 2S2S X S (j  )  S > 2  N  S < 2  N (aliasing) Fourier Transform of continuous function Fourier Transform of sampled function

5 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher5 Reconstruction Since spectrum of sampled signal consists of baseband spectrum and spectral images shifted at multiples of 2π/T, reconstruction means isolating the baseband image Concept: lowpass filter to pass baseband while removing images X S (j  )  NN -N-N SS -S-S 2S2S -2  S

6 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher6 Reconstruction (cont.) Multiplication by rectangular pulse in frequency domain (LPF) corresponds to convolution by sinc( ) function in time domain Because sinc( ) is non-causal and of infinite extent, practical reconstruction requires an approximation to the ideal case

7 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher7 Delay Lines In order to create a frequency-selective function, there must be a delay memory so that the function is able to observe and resolve the frequencies present in the signal Digital filters used tapped delay lines to create the z -1 (delay) terms in the z- transform

8 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher8 Delay Lines (cont.) Z -1 + h0h0 h1h1 h2h2 h3h3 x[n] x[n-1] y[n] x[n-2] x[n-3]

9 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher9 Delay Lines (cont.) Delay lines can be implemented easily as a one dimensional array or FIFO in DSP memory Typically use an address register to point to array, then just increment pointer instead of copying data to achieve the delay

10 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher10 Modulo Buffers DSP supports modulo arithmetic in the address generation unit With modulo buffer, incrementing or decrementing address register “rolls over” automatically at beginning and ending of buffer memory range Modulo buffers are useful for delay stages in filters and other FIFO queue structures

11 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher11 Modulo Buffers (cont.) Modulo calculations keep address pointer within a fixed range of memory locations Modulo N Buffer Memory N memory locations Base Address Base Address + N -1

12 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher12 56300 Modulo Buffers The M registers in the AGU select the modulo size of the buffer –M = $FFFFFF implies no modulo (regular linear addressing) –M = 0 implies bit-reversed addressing (useful in FFT algorithms) –M = ‘modulo’-1 implies address range including ‘modulo’ memory locations (2  modulo  $7FFF)

13 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher13 56300 Modulo (cont.) The base address of the modulo buffer must be a power of 2 The base address must either be zero, or a power of 2 that is greater than or equal to the modulo In other words, the base address must be 2 k, where 2 k  modulo, which implies k least significant bits must be zero

14 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher14 FIR Filter FIR filter coefficients are equal to the unit sample response of the filter Given filter specifications, we need to choose a unit sample response that is “close” to the desired response, yet within the implementation constraints (memory, computational complexity, etc.)

15 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher15 FIR Filter Design Several FIR design techniques are available Consider the Window method: –Determine ideal response function –If length of ideal function is too long, multiply ideal response by a finite length window function –Note that multiplication by window in time domain means convolution (and smearing) in the frequency domain

16 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher16 FIR Window Design Concept Lowpass filter: cutoff at 0.2 f s. 00.050.10.150.20.250.30.350.40.450.5 0 0.2 0.4 0.6 0.8 1 1.2 Frequency (fraction of fs) Amplitude (linear scale)

17 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher17 FIR Design Concept (cont.) Time domain response (Inverse DTFT) -60-40-200204060 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 Sample Index Amplitude

18 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher18 FIR Design Concept Window function to limit response length -60-40-200204060 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 Sample Index Amplitude Hamming window

19 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher19 FIR Design Concept (cont.) Windowed and shifted (causal) result 0510152025303540 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 Amplitude Sample Index

20 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher20 FIR Design Concept Resulting frequency response of filter 00.050.10.150.20.250.30.350.40.450.5 -60 -50 -40 -30 -20 -10 0 10 Frequency (fraction of fs) Magnitude (dB)

21 ECEN4002 Spring 2002Delay Lines and Simple Filters R. C. Maher21 Lab Assignment #2 Due at START of class in two weeks Topics: –Sampling and reconstruction (MATLAB) –Program #1: Cycle counting –Program #2: Simple delay line –Program #3: File I/O via Debugger –Program #4: FIR filter, non-real time –Program #5: FIR filter, real time


Download ppt "Sampling, Reconstruction, and Elementary Digital Filters R.C. Maher ECEN4002/5002 DSP Laboratory Spring 2002."

Similar presentations


Ads by Google