Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Digital Signal Processing (DSP) By: Assoc. Prof. Dr. Erhan A. İnce Electrical and Electronic Engineering Dept. SPRING 2016

Similar presentations


Presentation on theme: "1 Introduction to Digital Signal Processing (DSP) By: Assoc. Prof. Dr. Erhan A. İnce Electrical and Electronic Engineering Dept. SPRING 2016"— Presentation transcript:

1 1 Introduction to Digital Signal Processing (DSP) By: Assoc. Prof. Dr. Erhan A. İnce Electrical and Electronic Engineering Dept. SPRING 2016 e-mail: erhan.ince@emu.edu.trerhan.ince@emu.edu.tr http://faraday.ee.emu.edu.tr/eeng420

2 2 Digital Signal Processing And Its Benefits By a signal we mean any variable that carries or contains some kind of information that can be conveyed, displayed or manipulated. Examples of signals of particular interest to us engineers include: -Speech (encountered in telephony, radio, and everyday life )

3 3

4 4 ECG biomedical signals, (heart signals, brain signals) Tomography

5 5 Significant features of ECG waveform A typical scalar electrocardiographic lead is shown in Fig. 1, where the significant features of the waveform are the P, Q, R, S, and T waves, the duration of each wave, and certain time intervals such as the P-R, S-T, and Q-T intervals.

6 6  Sound and music, as reproduced by the compact disc player  Video and image,  Radar signals, which are used to determine the range and bearing of distant targets

7 7  Most of the signals in our environment are analog such as sound, temperature and light To processes these signals with a computer, we must: 1.convert the analog signals into electrical signals, e.g., using a transducer such as a microphone to convert sound into electrical signal 2.digitize these signals, or convert them from analog to digital, using an ADC (Analog to Digital Converter)

8 8 Steps in Digital Signal Processing An analog input signal is filtered to be a band-limited signal by an input lowpass filter Signal is then sampled and quantized by an ADC Digital signal is processed by a digital circuit, often a computer or a digital signal processor Processed digital signal is then converted back to an analog signal by a DAC The resulting step waveform is converted to a smooth signal by a reconstruction filter called an anti-imaging filter

9 9 Why do we need DSPs DSP operations require a lot of multiplying and adding operations of the form: A = B*C + D The multiply instruction of a GPP is very slow compared with the add instruction Motorola 68000 microprocessor uses 10 clock cycles for add 74 clock cycles for multiply

10 10  Digital signal processors can perform the multiply and the add operation in just one clock cycle  Most DSPs have a specialized instruction that causes them to multiply, add and save the result in a single cycle  This instruction is called a MAC (Multiply, Add, and Accumulate)

11 11 Attraction of DSP comes from key advantages such as : * Guaranteed accuracy: (accuracy is only determined by the number of bits used) * Perfect Reproducibility: Identical performance from unit to unit ie. A digital recording can be copied or reproduced several times with no loss in signal quality * No drift in performance with temperature and age * Uses advances in semiconductor technology to achieve: (i) smaller size (ii) lower cost (iii) low power consumption (iv) higher operating speed * Greater flexibility: Reprogrammable, no need to modify the hardware * Superior performance ie.linear phase response can be achieved complex adaptive filtering becomes possible

12 12 Disadvantages of DSP * Speed and Cost DSP techniques are limited to signals with relatively low bandwidths DSP designs can be expensive, especially when large bandwidth signals are involved. ADC or DACs are either to expensive or do not have sufficient resolution for wide bandwidth applications. * DSP designs can be time consuming plus need the necessary resources (software etc) * Finite word-length problems If only a limited number of bits is used due to economic considerations serious degradation in system performance may result.

13 13  The use of finite precision arithmetic makes it necessary to quantize filter calculations by rounding or truncation.  Round-off noise is that error in the filter output that results from rounding or truncating calculations within the filter.  As the name implies, this error looks like low-level noise at the filter output

14 14 Application Areas Image Processing Instrumentation/ControlSpeech/Audio Military Pattern recognition spectrum analysis speech recognition secure communications Robotic vision noise reduction speech synthesis radar processing Image enhancement data compression text to speech sonar processing Facsimile position and ratedigital audio missile guidance animation controlequalization TelecommunicationsBiomedicalConsumer applications Echo cancellationpatient monitoringcellular mobile phones Adaptive equalizationscannersUMTS ADPCM trans-codersEEG brain mappersdigital television Spread spectrumECG Analysisdigital cameras Video conferencingX-Ray storage/enhancement internet phone etc.

15 15 Key DSP Operations 1. Convolution 2. Correlation 3. Digital Filtering 4. Discrete Transformation 5. Modulation

16 16 Convolution Convolution is one of the most frequently used operations in DSP. Specially in digital filtering applications where two finite and causal sequences x[n] and h[n] of lengths N 1 and N 2 are convolved where, n = 0,1,…….,(M-1) and M = N 1 + N 2 -1 This is a multiply and accumulate operation and DSP device manufacturers have developed signal processors that perform this action.

17 17 We can also use the ensemble of realizations to obtain the mean value as:

18 18 For an ergodic process, the sample mean would be: Expected value of the sample mean is equal to the population mean m Proof:

19 19 Correlation There are two forms of correlation : 1. Auto-correlation 2. Cross-correlation

20 20 Cross-correlation: Cross-correlation between two random variables is defined as: If x(n) = y(n) the correlation is known as auto-correlation. For an ensemble of realizations the autocorrelation function can be defined as:

21 21

22 22 Example: Using the figure 13.1.1 find the mean for n =10 and the autocorrelation for a time difference of 5 (say n = 20 and n =25)

23 23

24 24 Figure 13.2.1 shows the mean value at 20 individual times and the auto-correlation function for 20 differences (from 0 to 49), known as lags. We note that as the number of realizations increase, the mean tends to zero and the autocorrelation tends to a delta function as expected. Here the random variables are independent and identically distributed (iid) Their pdfs is Gaussian. If the rv’s are independent then the auto-correlation is a delta function. To find the unbiased sample autocorrelation function from one realization (ergodic process) we use the formula:

25 25 The absolute value m ensures the symmetry of the sample auto-correlation Sequence at n = 0. Sometimes the formula will produce autocorrelation matrices that do not have an inverse. Therefore, it is customary in practice to use a biased formula:

26 26

27 27

28 28

29 29

30 30

31 31 Correlation coefficient for discrete signals Normalized version of the cross-covarience is known as the correlation coefficient and is defined as below Where, r xy (n) is an estimate of the cross-covarience

32 32 The cross-covarience is defined as

33 33 A=[ones(1,4),zeros(1,8),ones(1,8)]; A2=filter([0,0,0,0,0,1],1,A); [acor, lags]= xcorr(A,A2); subplot(3,1,1),stem(A), title('Original signal A'); subplot(3,1,2),stem(A2), title('Sample shifted signal A2'); subplot(3,1,3), stem(lags,acor/length(A)) title('Full cross-correlation of A and A2');

34 34 Digital Filtering The equation for finite impulse response (FIR) filtering is Where, x[k] and y[k] are the input and output of the filter respectively and h[k] for k = 0,1,2,………,N-1 are the filter coefficients

35 35 Filter structure A common filtering objective is to remove or reduce noise from a wanted signal.

36 36 Figure : Reconstructed bi-level text images for degradation caused by h 1 and AWGN. (a) Original, (b) 2D Inverse, (c) 2D Wiener, (d)PIDD, (e) 2D VA-DF, (f) PEB-FCNRT

37 37 Discrete Transformation Discrete transforms allow the representation of discrete-time signals in the frequency domain or the conversion between time and frequency domain representations. Many discrete transformations exists but the discrete Fourier transform (DFT) is the most widely used one. DFT is defined as: IDFT is defined as:

38 38 MATLAB function for DFT function [Xk] = dft(xn) N=length(xn); n = 0:1:N-1; % row vector for n k = 0:1:N-1; % row vecor for k WN = exp(-1*j*2*pi/N); % Twiddle factor (w) nk = n'*k; % creates a N by N matrix of nk values WNnk = WN.^ nk; % DFT matrix Xk = (WNnk*xn' );

39 39 Matlab Function for IDFT function [xn] = idft(Xk) % Computes Inverse Discrete Transform % ----------------------------------- % [xn] = idft(Xk) % xn = N-point sequence over 0 <= n <= N-1 % Xk = DFT coeff. array over 0 <= k <= N-1 % N = length of DFT % N = length(Xk); n = [0:1:N-1]; % row vector for n k = [0:1:N-1]; % row vecor for k WN = exp(-j*2*pi/N); % Wn factor nk = n'*k; % creates a N by N matrix of nk values WNnk = WN.^ (-nk); % IDFT matrix xn = abs(Xk' * WNnk')/N; % row vector for IDFT values

40 40 Example Let x[n] be a 4-point sequence >>x=[1, 1, 1, 1]; >>N = 4; >>X = dft(x,N); >>magX = abs(X) ; >>phaX = angle(X) * 180/pi; magX= 4.0000 0.0000 0.0000 0.0000 phaX= 0-134.981-90.00-44.997

41 41 Modulation Discrete signals are rarely transmitted over long distances or stored in large quantities in their raw form. Signals are normally modulated to match their frequency characteristic to those of the transmission and/or storage media to minimize signal distortion, to utilize the available bandwidth efficiently, or to ensure that the signal have some desirable properties. Two application areas where the idea of modulation is extensively used are: 1. telecommunications 2. digital audio engineering High frequency signal is the carrier The signal we wish to transmit is the modulating signal

42 42 Three most commonly used digital modulation schemes for transmitting Digital data over bandpass channels are: Amplitude shift keying (ASK) Phase shift keying (PSK) Frequency shift keying (FSK) When digital data is transmitted over an all digital network a scheme known As pulse code modulation (PCM) is used.


Download ppt "1 Introduction to Digital Signal Processing (DSP) By: Assoc. Prof. Dr. Erhan A. İnce Electrical and Electronic Engineering Dept. SPRING 2016"

Similar presentations


Ads by Google