Introduction to Digital Signal Processing Slides
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Digital Signal Processing slides Dr. Gal Ben--DavidDavid Winter 2009//20102010 11 Agenda Signal and Systems brushbrush--up,up, Poisson formulas Sampling: Point sampling, Impulse Sampling, BandBand-- pass Sampling, Nyquist Rate, Shannon reconstruction DFT --DiscreteDiscrete Fourier Transform, Spectrum analysis, Windows, Zero Padding, Cyclic convolution, Periodic Signals, FFT Continuous Phase representation, Linear Phase, Minimum Phase, All Pass FIR filters, IRT Method, Windows, Equiripple IIR Filter, Analog filters, Impulse invariance, Bilinear Transform MultirateMultirate,, Decimation, Interpolation 22 Course requirements Theoretic Homework (up to 2 students per submisssubmission)ion) --88%% Matlab exercises (up to 2 students per submission) ––88%% No grade transfer Final Exam ––MoedMoed A, B, Miluim --8484%% Note that for a 170170++ students class we cannot find personal “solutions” for grades (i.e., no oral exams, no extra homework, no special exam dates, ….) Intensive use of Moodle for announcements, forums, sound files, submission, HW partners, homework, solutions, ask your lecturer 33 Literature Malah--RazRaz (Hebrew) + Equiripple + Multirate -- DFT frequency zero padding --IIRIIR ChebCheb.,., Elliptic filters will be given in tutorial only B. PoratPorat,, A Course in Digital Signal Processing, J. Wiley, 1997 44 Analog Signal Processing ω y( ) = 1 x(t) y(t) x()ω 1+ jωRC In fact R can be purchased (within reasonable price) at 1% precision, while C is 10% accurate. The corner frequency is accurate to ~10% (3-4 bit) 55 Analog Signal Processing Legacy ––Resistors,Resistors, Capacitors, Operational AmplifiAmplifiersers Mostly used for filtering Simple Limited in scope Limited in accuracy Cannot be adapted Repeatability problems Aging Sensitivity to the environment Uncertain performance in production units Variation in performance of units Sensitive analog traces on PCBs 66 Digital Signal Processing Platform General purpose computers Dedicated Signal Processors Dedicated hardware Accuracy only depends on computer registers Flexible Repeatable Adaptive May be more sophisticated 77 What is DSP? Digital Signal Processing – the processing or manipulation of signals using digital techniques Digital Output Input ADC Signal DAC Signal Processor Signal Analogue Digital to to Digital Analogue Converter Converter Speech Processing Speech coding/compression Speech synthesis Speech recognition Some Properties of Speech Vowels “oo” in “blue” “o” in “spot” “ee” in “key” “e” in “again” •Quasi-periodic •Relatively high signal power Consonants “s” in “spot” “k” in “key” •Non-periodic (random) •Relatively low signal power Speech Coding 64 kbits/s 22.8 kbits/s 13 kbits/s BTS Speech Coding – Vocoder Encoder Original Speech Analysis: • Voiced/Unvoiced decision • Pitch Period (voiced only) • Signal power (Gain) Pitch Decoder Period Signal Power Pulse Train V/U G Vocal Tract Model Synthesized Speech Random Noise Digital Audio Standard music CD: kz1H Sampling .1 44. Rate: apSmling kHzaRte: 44 16 16--bit samples 22--channelchannel stereo Data transfer rate = 1622×× ,100 16×× 44,100 = 44 11..44 Mbits/s 1 hour of music = 11..44××33,,600600 = 635 MB Audio Coding (Cont’d) Key standards: MPEG: Layers I, II, and III (MP33);); AAC. •• used in DAB, DVD Dolby AC33,, Dolby Digital, Dolby Surround. Typical bit rates for 2--channel stereo: 6464kbits/skbits/s to 384 kbits/s. Subband--oror transform--based,based, making use of perceptual masking properties. Image/Video Still Image Coding: JPEG (Joint Photographic Experts Group): •• Discrete Cosine Transform (DCT) based JPEGJPEG20002000:: Wavelet Transform based Video Coding: MPEG (Moving Pictures Experts Group): •• DCTDCT--based,based, •• Interframe and intraframe prediction, •• Motion estimation. •• MPEGMPEG--11,, MPEGMPEG--22,, MPEGMPEG--44 H.H.261261,, H.H.263263,H.,H.264264 Applications: Digital TV, DVD, Video conference,etcconference,etc.. Some Other Application Areas Image analysis, e.ge.g:: Human recognition, Optical Character Recognition (OCR); Restoration of old image, video, and audio signals; Analysis of RADAR data; Analysis of SONAR data; Data transmission (modems, radio, echo cancellation, channel equalization, etc.); Storage and archiving; Control of electric motors (!). DSP Devices & Architectures Selecting a DSP ––severalseveral choices: FixedFixed--point;point; Floating point; ApplicationApplication--specificspecific devices (e.g. FFT processors, speech recognizers,etcrecognizers,etc.)..). DSP Manufacturers: Texas Instruments ( http://www.ti.com)) Motorola/Motorola/FreescaleFreescale ((http://www.motorola.com)) Analog Devices ( http://www.analog.com)) Israel: DSP Group, ZoranZoran,, ECI, Rafael, ElbitElbit,, IAI, Comverse, Intel, Microsoft, EltaElta,, MAFMAF--AT,AT, .... Typical DSP Operations – MADD/MACC • Filtering Convolution • Energy of Signal • Frequency transforms Pseudo C code for (n=0; n<N; n++) { s=0; for (i=0; i<L; i++) { s += a[i] * x[n-i]; } y[n] = s; } Traditional DSP Architecture X RAM Y RAM x(n-i) ai Multiply/Accumulate Accumulator y(n) Sampling and quantization Amplitude Discrete 50 Continuous 49 48 47 46 45 T 2T Time 2020 Continuous Time Fourier Transform Continuous time signal CTFT Angular frequency ω = 2πf Sufficient condition 2121 Inverse CTFT Reconstruction of non continuous point 2222 Dirchlet conditions In each finite section, x(t) has finite number of non --continuous points. The “jump” is finite Bounded variation ––FiniteFinite number of extreme points in each finite section 2323 Sinc in time Gate in frequency Note: X(t) is not absolute integrable 2424 Gate in time Sinc in frequency The inverse transform 2525 Order 1 Low pass filter 2626 Order 1 Low pass filter 2727 CTFT 82 82 CTFT 92 92 CTFT 03 03 Delta or Unit Impulse Function, δ(t) The delta or unit impulse function, δδ((tt)) Mathematical definition (non(non--purepure version) 0 t ≠ t δ (t − t ) = 0 0 ⋅∞ = 1 t t0 Graphical illustration δ(t) 1 t 0 t0 3131 Dirac delta function Impulse Function For f() continuous at τ Impulse function in time contains all frequencies - same amplitude 3232 DC in time Impulse in frequency 33 33 Harmonic exponentials 43 43 COS /SIN 3535 SISO – Single Input – Single Output Systems A linear Linear system has a zero response for zero stimulus Time invariant 3636 Linear Time--InvariantInvariant Systems δ x(t)= (t) System h(t) T t t If a LTI system is excited by an input x(t) = δ(t), the output is called the impulse response h(t) = T{δ (t)} 3737 Unit Impulse Any continuous function can be written as weighted ‘sum’ of impulses as ∞ x(t) = ∫ x(τ )δ (t −τ )dτ −∞ 3838 Response to Arbitrary Input ∞ y(t) = T{}x(t) = T ∫ x(τ )δ (t −τ )dτ −∞ ∞ = ∫ x(τ )T{δ (t −τ )}dτ −∞ But since the system is time invariant T{δ (t −τ )}= h(t −τ ) ∞ y(t) = ∫ x(τ )h(t −τ )dτ −∞ y(t) = x(t)∗h(t) 3939 Convolution ∞ y(t) = ∫ x(τ )h(t −τ )dτ −∞ y(t) = x(t)∗h(t) x(t)LTI System y(t) h(t) 4040 Properties of the Convolution Integral Commutative y(t) = x(t)∗ h(t) = h(t)∗ x(t) Associative ∗ ∗ = ∗ ∗ {}{}x(t) h1(t) h2 (t) x(t) h1(t) h2 (t) Distributive ∗ + = ∗ + ∗ x(t) {}h1(t) h2 (t) x(t) h1(t) x(t) h2 (t) 4141 Eigenfunctions of ContinuousContinuous--TimeTime LTI Systems ∞ y(t) = ∫ x(t −τ )h(τ )dτ x(t)=e st LTI System − ∞ h(t) ∞ ∞ y(t) = ∫ h(τ )es( t−τ )dτ = est ∫ h(τ )e−sτ dτ − ∞ − ∞ = H (s)est = λest λ is the eigenvalue of the system associated with the eigenfunction e st , a complex constant 24 24 Eigenfunctions of ContinuousContinuous--TimeTime LTI Systems Harmonic input Harmonic output 0 0 4343 Transfer function Define Harmonic in Harmonic out LTI system changes the amplitude and phase of harmonic signals 4444 LTI Real impulse response systems 4545 Periodic function f (t) f (t) = f (t + kT) ∀ ,t ∀k t T T f(t) ⇒ a series of frequencies multiple of 1/T 4646 Orthogonal basis 74 74 Single Periodic extension period f (t) t T CTFT of the single period The Fourier series coefficients are samples of the CTFT of the single period function Samples in frequency – Periodicity in time 4848 Poisson Sum formula We get spectral lines 94 94 )t(f F(ω) t ω T )t(f F(ω) t ω T T ω 0 05 05 Poisson Sum formula The formula may be used for arbitrary x I(). For the impulse function 5151 Poisson Sum formula Impulse train in time – Impulse train in frequency 25 25 Sampling “quick and dirty” x(t) X(f) t BW p(t) P(f) f t T F=1/T x(t)p(t) X(f)*P(f) f t f Harry Nyquist (1889-1976) – Replicas will not overlap if F>2BW 5353 Parseval equation Sum of Energy of Single period energy Fourier coefficients 5454 Symmetry for real x(t) The Fourier series is composed of cosines 55 55 Finite Fourier series Instead of infinite series, we approximate by using 2N-1 elements Best approximation for the L 2 metric - Gibbs 5656 Periodic functions and LTI Systems H( ω) ∞ + ω ⋅ jk ω0 ψ ()kω0 ∑ ak H ()k 0 e k =−∞ The reponse to a periodic function is also periodic 5757 The Discrete time Fourier transform X f (θ ) = X f (θ + 2π ) Existence sufficient condition Inverse transform 5858 Example 95 95 Harmonic functions 06 06 DTFT 16 16 DTFT 26 26 DTFT 36 36 Unit sample response δ x(n)= (n) System h(n) h(n) t Convulution 6464 Response to harmonic signal Eigenfunction Frequency response 6565 Discrete time periodic signals Note that cos signal is periodic only if rational 6666 Sampling 76 76 Sampling --AliasingAliasing 1.2 1 __ 0.8 s(t) = sin(2πf0t) 0.6 0.4 s(t) @ f S 0.2 0 f0 = 1 Hz, f S = 3 Hz -0.2 tt -0.4 -0.6 -0.8 __ -0.8 s1(t) = sin( 8πf0t) -1 -1.2 __ s2(t) = sin(14 πf0t) s(t) @ f S represents exactly all sine-waves s k(t) defined by: ∈ sk (t) = sin( 2π (f 0 + k f S) t ) , k 6868 Sampling of continuous time x(t) Sampling frequency Sampling period What is the relationship between the CTFT of x(t) and the DTFT of x(n)? 6969 Inverse CTFT We calculate the infinite integral in sections of 2π/T XF(ω) …… ω −3π/T -π/T π/T 3π/T 7070 Compare to 17 17 Sampling 27 27 Band limited signal.