CG40 Advanced Dr Stuart Lawson Room A330 Tel: 23780 e-mail: ssl@eng.warwick.ac.uk 03 January 2003
Lecture : Overview INTRODUCTION What is a signal? An information-bearing quantity. Examples of -D and 2-D signals Speech Image Video Radar/Sonar Why Digital? Guaranteed accuracy Reproducibility No drift Affect of advances in VLSI technology Flexibility Performance Disadvantages Speed and cost Design time Finite wordlength What type of signal processing do we want to do? Smoothing Limiting Filtering, Convolution Decimation and Interpolation Spectral Analysis Correlation, Detection Estimation Compression Applications Seismology Telecommunications Speech Imaging Radar/Sonar Control Biomedical Acoustics Meteorology Oceanography Astrophysics Geophysics Hardware Issues Finite wordlength effects Coefficient quantization, roundoff noise, limit cycles Concept of structure in a digital filter DSP Architecture multiply-add operation is the cornerstone 2
DSP Microprocessors Parallel processing Some useful texts E.C.Ifeachor & B.W.Jervis, Digital, Prentice-Hall, 2002. J.G.Proakis & D.G.Manolakis, Digital, Prentice-Hall, 996. P.P.Vaidyanathan, Multirate Systems and Filter Banks, Prentice-Hall, 993. M.Vetterli & J.Kovacevic, Wavelets and Subband Coding, Prentice-Hall,995. C.W.Therrien, Discrete Random Signals and Statistical, Prentice- Hall, 992. L.Cohen, Time-Frequency Analysis, Prentice-Hall, 995. R.A.Roberts and C.T.Mullis, Digital, Addison-Wesley,987. D.E.Newland, Random Vibrations, Spectral and Wavelet Analysis, 3 rd edition, Longman, 993. MATLAB - A tool for digital signal processing(dsp) Matrix/vector operations Toolboxes, including signal processing and wavelets Coursework task involving real data and MATLAB. Module structure Your background for this course Knowledge of transforms such as Fourier, Laplace and Z. Linear systems. Time - domain and frequency re sponses. Digital Filters. Discrete Fourier Transform. CG35 Digital. DIGITAL FILTERING Linear fixed Lowpass, Bandpass, Highpass, Bandstop Allpass Finite Impulse Response(FIR) Infinite Impulse Response(IIR) Matched Filter Linear adaptive Kalman Filter LMS Algorithm Non-linear DIGITAL FILTER DESIGN Specification 3
Gain 0 0 fs fp fp2 fs2 Fs/2 Frequency FIR filters Windowing Remez Exchange Algorithm IIR filters Bilinear transformation Design from continuous-time filters Impulse invariance Direct design Use of MATLAB Examples DISCRETE FOURIER TRANSFORM Transform Pair N kl l k N k = 0 Forward Transform: X = x W where W ( j N ) = exp 2π /, l = 0,, 2,, N N Inverse Transform: x where k = 0,, 2,, N N N kl k = X lwn l= 0 Properties:. Linearity 2. If { } x k is real then X * = X = X N 3. DFT x y = X Y m= 0 m n m l l N l k k 4. If sampling rate is f s = / T samples per second then resolution in transform domain, f = f / N = / NT, where N is the size of the data record. s 4
5. W N N = 6. The DFT can be put into matrix format as X = Vx FAST FOURIER TRANSFORM The function W N has interesting properties and these can be exploited. ( )( ) n+ mn k+ ln nk For example, W = W where m,l are integral. 0 N 4 N 2 3N 4 Also W =, W / = j, W / =, W / = j N N N N The DFT algorithm requires of the order of N 2 arithmetic operations and a more efficient method of transforming data for spectral analysis with large datasets was desperately required. M The FFT algorithm in its simplest form takes a dataset of N = 2 points and splits it into two equal parts and then again and again until the number of points in each partition is 2 for which a DFT is then performed. This can be appreciated visually in the following illustrations. The number of arithmetic operations reduces to N log 2 N. N DFT FFT Index 6 024 60 6.4 64 4096 384 0.7 256 65536 2048 32.0 024 048576 0240 02.4 x0 x4 2-Point DFT X0 X x2 x6 2-Point DFT X2 X3 x x5 2-Point DFT X4 X5 x3 x7 2-Point DFT X6 X7 5
x0 x4 x2 x6 x x5 x3 x7 X0 X X2 X3 X4 X5 X6 X7 Bit Reversal Natural Sequence Shuffled Sequence 000 000 00 00 00 00 0 0 00 00 0 0 0 0 Note: Basic FFT Calculation At each stage the following arithmetic computations need to be performed: k X = A + W B k Y = A WN B Known as a Butterfly N SPECTRAL ANALYSIS Generally, the signal whose spectrum is required, is random and does not therefore have a Fourier transform. We can use the Wiener -Khinchine theorem which states that the Fourier transform of the autocorrelation of a random signal is its power spectral density and that this can be simply obtained from the DFT output. We can sample the signal at an appropriate rate, bearing in mind the frequency resolution required and estimate its spectrum using the DFT or FFT. Algorithm. Remove any mean value from signal using x = x x 2. Use an appropriate window function 3. Carry out DFT or FFT 4. Smooth spectral estimate k k 6
5. Compute power spectral density estimate using P ( l) N X xx = 2 l 6. Average over several power spectral estimates Spectral Leakage WINDOWING A sample of size N from a random signal can be though of as a product of the entire random t Tm signal with a rectangular window function, w( t) =. 0 t > T The rapid transition at each end of the window leads to a ringing effect in the frequency domain. To reduce this effect, the sampled data is multiplied by a function with a smoother transition from to 0, e.g. Hanning window. The Hanning window is defined as follows: m 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 w( t) = 2 0 π t + cos T m t T t > T m m Many other window types including Kaiser, Hamming, etc. 7
DETECTION OF SIGNALS IN NOISE Consider a signal buried in additive white noise x[ n] = s[ n] + w[ n] 0 n N To detect s[ n], which is know and deterministic, we can correlate received signal with a replica of s[ n] and use thresholding to announce detection. Correlation operation is N k= 0 s [ k] x[ k] r Alternative approach is to use a matched filter instead of the correlator. A matched filter is defined as follows: N y[ n] = h[ n]* x[ n] = h[ n k] x[ k] where h[ n] is the unit pulse response of the filter. This is the reverse of the original signal, s[ n]. For filter to be realisable, the transmitted signal must have finite duration. In practice it is often a linear or FM chirp. TARGET TRACKING Often it is required to track a signal whose characteristics may be changing. We can use an adaptive filter which can update its coefficients as the input signal varies. An example is the tracking of a moving target, such as in sonar or radar. In diagram, a target is being tracked in range and angle. It will be assumed that the equations of motion are known although the exact motion is unknown. The measurement of the position variables ( d,θ ) can only be made with some uncertainty because of noise. The optimal recursive filter which minimises the average squared error is shown below: k= 0 Observations Error Gain Dynamic Model Current position variables Delay Predicted position variables Uncorrelated random variable 8
d θ TIME-FREQUENCY REPRESENTATIONS For signals that are time varying in the sense that, for instance, their frequencies are not constant. Imagine a signal that for the first few seconds of its life, its frequency content lies below 00Hz and for the rest of its li fe, the frequency content lies between 200Hz and 600Hz. How can this be represented as the signal is varying in time and in frequency? The solution to this problem lies in a time-frequency diagram, often called a spectrogram although strictly this relates to the short-time Fourier transform. 9
0
Real-world applications. Digital audio mixing Post-mix Processing Audio Input Signals Pre-mix Processing Mix matrix 32 inputs 6 outputs Processed audio signals 32 32 6 Post-mix Processing 6 Block diagram of a digital mixing desk (after Ifeachor & Jervis, Digital, 2 nd.ed., Prentice-Hall, 2002). 2. Speech Recognition Microphone ADC Parameter Extraction Pattern Matching Output Device Template memory Block diagram of a speech recognition system (after Ifeachor & Jervis, Digital Signal Processing, 2 nd.ed., Prentice-Hall, 2002). 3. Compact disc system Features LP record Compact Disc Frequency response 30Hz to 20kHz ( ± 3dB) 20Hz to 20kHz (+0.5 to db) Dynamic range 70dB (at khz) >90dB Signal-to-noise ratio 60dB >90dB Harmonic Distortion % to 2% 0.004% Stereo channel separation 25 to 30dB >90dB Wow and flutter 0.03% Not detectable Effect of dust, scratches, fingermarks, etc. Causes noise Leads to correctable or concealable errors Durability HF response degrades with Semi-permanent playing Stylus life 500 to 600 hours Semi-permanent Playing time 40 to 45 minutes (2 sides) 50 to 75 minutes from Ifeachor & Jervis, Digital, 2 nd.ed., Prentice-Hall, 2002.
Block diagram of the audio signal processing and recording in the CD system (from Ifeachor & Jervis, Digital, 2 nd.ed., Prentice-Hall, 2002). Block diagram of the CD playback system (from Ifeachor & Jervis, Digital, 2 nd.ed., Prentice-Hall, 2002). 2
4. Foetal ECG monitoring 3
Figure.24 (a) Approximation and (b) removal of baseline shift from the raw foetal ECG 4