36
EE 5108: DIGITAL SIGNAL PROCESSING LABORATORYORATORY LIST OF EXPERIMENTS: COMPULSORY EXPERIMENTS: 1. Familiarization with MATLAB 2. Generation of the following sequence and to plot them using MATLAB: a. Unit Sample Sequence D[n] b. Unit Step Sequence u[n] c. Ramp Sequence n. u[n] d. Exponential Sequences e. Sine / Cosine Sequences 3. Verification of the following general properties using MATLAB a. Linearity b. Time Shifting c. Frequency Shifting 4. Computation of the linear convolution of two finite- length sequences using MATLAB 5. Obtaining the Partial Fraction Expansion of the Z- Transform expression and to find its Inverse Z- Transforms using MATLAB 6. Testing for the stability of given Discrete Time Systems using MATLAB 7. To write a MATLAB program for finding out the output of two Periodic Digital sequences using Circular Convolution. Compare your result with that obtained by theoretical evaluation 8. Computation of N-point DFT of the length-N sequence using MATLAB 9. Development of the program for finding out DFT and FFT using TMS 320C6713 DSK Processor

Digital Signal Processing Lab

Embed Size (px)

Citation preview

EE 5108: DIGITAL SIGNAL PROCESSING LABORATORYORATORYLIST OF EXPERIMENTS:COMPULSORY EXPERIMENTS:1. Familiarization with MATLAB2. Generation of the following sequence and to plot them using MATLAB:a. Unit Sample Sequence [n]b. Unit Step Sequence u[n]c. Ramp Sequence n. u[n]d. Exponential Sequencese. Sine / Cosine Sequences3. Verification of the following general properties using MATLABa. Linearityb. Time Shiftingc. Frequency Shifting4. Computation of the linear convolution of two finite-length sequences using MATLAB5. Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLAB6. Testing for the stability of given Discrete Time Systems using MATLAB7. To write a MATLAB program for finding out the output of two Periodic Digital sequences using Circular Convolution. Compare your result with that obtained by theoretical evaluation8. Computation of N-point DFT of the length-N sequence using MATLAB9. Development of the program for finding out DFT and FFT using TMS 320C6713 DSK Processor10. To write a program and simulate using C language / assembly language for computation of Linear Convolution using TMS 320C6713 DSK Processor11. To write a program and simulate using C language / assembly language for computation of Auto/ Cross Correlation using TMS Processor12. To write a program and simulate using C language / assembly language for designing a Digital Filter (LP/ HP / BP / BR) using TMS 320C6713 DSK Processor OPTIONAL EXPERIMENTS : 13. To develop a MATLAB program to convert Analog to Digital Frequencies using Bilinear Transformation14. To design a Butterworth filter using standard design steps (for LP, HP, BP & BR filters), i.e. find out the order of the filter when Pass Band Gain, Sampling frequency and Pass Band and Stop Band Cut-Off frequencies are given. Then find out the Normalized Transfer Function and Actual Transfer Function15. To design a Chebyshev filter using standard design steps (general programs for LP, HP, BP & BR filter design)16. To develop a Cascade realization of the given Linear-Phase FIR/ IIR transfer functions using MATLAB17. To write a MATLAB program to compute the Cross Correlation of two finite-length sequences. Compare your result with that obtained by theoretical evaluation18. To write a MATLAB program to compute the Auto Correlation of two finite-length sequences. Compare your result with that obtained by theoretical evaluation19. To write a MATLAB program to compute the PSD of two Sinusoids20. To write a MATLAB program to compute the Inverse DFT21. To write a MATLAB program for transforming an Analog filter into a Digital filter using Impulse invariant technique22. To develop programs for following Frequency Transformations in the design of Digital filter: LP to Normalized Low Pass Transformations (NLPT); HP to NLPT; BP to NLPT; BR to NLPT23. To develop a general program for Non-Recursive (FIR) filter using Rectangular, Hanning, Hamming, Blackman and Kaiser Window techniques24. To implement LMS algorithm using TMS DSK 320C6713 DSK ProcessorDEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONFAMILIARIZATION WITH MATLABBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Familiarization with MATLABINSTRUMENTS: MATLABTHEORY:MATLAB is a high performance language for technical computing. It integrated computation, visualization, and programming in an easy to use environment, where problems and solutions are expressed in familiar mathematical notation. MATLAB feature s a family of application specific solutions called toolboxes.PROGRAM:Some basic matrix operations such as addition, subtraction, multiplication, inversion, etc. RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONGENERATION OF THE FOLLOWING SEQUENCE AND TO PLOT THEM USING MATLAB:UNIT SAMPLE SEQUENCE [N], UNIT STEP SEQUENCE U[N],RAMP SEQUENCE N. U[N], EXPONENTIAL SEQUENCES, SINE / COSINE SEQUENCESBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Generation of the following sequence and to plot them using MATLAB:a. Unit Sample Sequence [n]b. Unit Step Sequence u[n]c. Ramp Sequence n. u[n]d. Exponential Sequencese. Sine / Cosine SequencesSOFTWARE: MATLABTHEORY:(a) Unit sample sequence,(n), is defined as(n) = 1, n = 0 = 0, n 0(b) Unit step sequence is defined as u(n) = 1 , n 0 = 0, n < 0(c) Unit ramp sequence is defined as r (n) = nu(n) = n, n 0 = 0 , n < 0(d) Exponential sequence are defined by x(n) = an where a is real constant for - n (e) Sinusoidal sequence are given by x(n) = sin n where = 2f = 2k/N PROGRAM:To express the above sequence in graphical representation for finite duration. The input parameters to be specified are the desired length & the simplify frequency.RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONVERIFICATION OF THE FOLLOWING GENERAL PROPERTIES USING MATLAB: LINEARITY, TIME SHIFTING, FREQUENCY SHIFTINGBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Verification of the following general properties using MATLABa. Linearityb. Time Shiftingc. Frequency ShiftingSOFTWARE: MATLAB 7.0THEORY:1. Linear System:(a) A system is said to be linear if it satisfies the principle of superposition & homogeneity. It status that the response of the system to weighted sum of input is equal to the corresponding weighted sum of response of the system to each of the individual inputs.Let y1(n) = [x1(n)] y2(n) = [x2(n)] y3(n) = [a1x1(n) + a2x2(n)]The system is linear if y3(n)= a1y1(n) + a2y2(n) where a & b are constants.(b) Time Shifting If x(n) is shifting in time to get x(n-K), then is called time delay whereas if x(n + K), it is called time advance, where K is same the integer.(c) Frequency ShiftingIf x(n) DTFTx ()Then X(n) DTFT n je0 x( - 0) PROGRAM:To do by the students making use of function inline.RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONCOMPUTATION OF THE LINEAR CONVOLUTION OF TWO FINITE-LENGTH SEQUENCES USING MATLABBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Computation of the linear convolution of two finite-length sequences using MATLABSOFTWARE: MATLAB 7THEORY:The linear convolution is used to obtain the response of an LTI system for any given input when its impulse response known . We can say that the input x(n) is convolved with the impulse the h(n) to produce the output y(n).The convolution sum is given byY(n) = x(n) * h(n) = K K n h K x ) ( ) (Involving four steps : Folding, Shifting, Multiplication & Summation. PROGRAM:First develop a program to compute output using linear convolution sum with the inputs are two finite duration sequences. Display the output starting the point of origin. If there are M no. of samples in first sequence & N no. of samples in second sequence then the no. of samples in output sequence must be (M+N-1).RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONOBTAINING THE PARTIAL FRACTION EXPANSION OF THE Z-TRANSFORM EXPRESSION AND TO FIND ITS INVERSE Z-TRANSFORMS USING MATLABBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Obtaining the Partial Fraction Expansion of the Z-Transform expression and to find its Inverse Z-Transforms using MATLABSOFTWARE: MATLAB 7THEORY:The Z-Transform of signal x(n) is given by X(z) = nnZ n x ) ( ROC of x(z) is the set of all values of z for which X(z) attains a finite value.The inverse procedure ie, obtaining x(n) from X(z) is called the inverse Z-transform.By partial fraction expansion, we can writeX(z) = X1(z)+ X2(z)+ X3(z)+..Taking inverse Z-transform, we getx(z) = x1(z)+ x2(z)+ x3(z)+.. PROGRAM:Expression the X(z) in rational from & then apply partial fraction expansion using the function residues. Display the result in time-domain.RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONTESTING FOR THE STABILITY OF GIVENDISCRETE TIME SYSTEMS USING MATLABBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Testing for the stability of given Discrete Time Systems using MATLABSOFTWARE: MATLAB 7THEORY:STABILITY:The roots of the denominator polynomial or the poles of the transfer function of the linear time invariant system will determine whether the system is stable, unstable & marginal stable. Provided that degree of the polynomial greater than or equal to the degree of the numerical polynomial.1. Stable system: When all the poles of the transfer function must lies in the left half of s-plane.2. Unstable system : If any of poles lies in right side of s-plane.3. Marginal stable: If any poles on jw-axis in the s-plane provided the other poles at x(s) lies in the left half s-plane. Stability in case of Z transform: A casual linear time invariant system is one whose unit sample response h(n) satisfies the condition h(n) = 0 , n< 0.ROC of the Z transform of a casual sequence is the exterior of a circle. Consequently a linear time invariant system is casual if and only if the ROC of the system function is the exterior of a circle of radius < including the point Z = Necessary and sufficient condition for a linear time invariant system to be BIBO stable is < n n h ) (Therefore a linear time invariant system is BIBO stable if and only if the ROC of the system function includes the units circle. PROGRAM:RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONTO WRITE A MATLAB PROGRAM FOR FINDING OUT THE OUTPUT OF TWO PERIODIC DIGITAL SEQUENCES USING CIRCULAR CONVOLUTION. COMPARE YOUR RESULT WITH THAT OBTAINED BY THEORETICAL EVALUATIONBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: To write a MATLAB program for finding out the output of two Periodic Digital sequences using Circular Convolution. Compare your result with that obtained by theoretical evaluationSOFTWARE: MATLAB 7THEORY: Let x1(n) and x2(n) are finite duration sequence both of length N with DFTs X1(K) and X2(K) . Now we find a sequence x3(n) for which the DFT is X3(K) where,X3(K) = X1(K) X2(K) ---------(i)NNm N N m n x m x n x )) (( )) (( )) ((102 1 3 for 0 n (n-1)x3((n))N = x3(n); similarly x1((m))N = x1(m)NNM m n x m x n x )) ( ( ) ( ) (102 1 3 -----------------(ii)The above equation represents the circular convolution of x1(n) and x2(n) representsX3(n) = x1(n)x2(n)------------------(iii)Form equation (i) and (iii), we find thatDFT [x1(n)x2(n)] = X1(K)X2(K)PROGRAM:RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONCOMPUTATION OF N-POINT DFT OF THE LENGTH-N SEQUENCE USING MATLABBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Computation of N-point DFT of the length-N sequence using MATLABSOFTWARE: MATLABTHEORY:The discrete Fourier transform is a powerful computation tool which allows us to evaluate the Fourier transform X(ei) on a digital computer or specially designed digital hardware.The DFT is obtained by sampling one period of the Fourier transform at a finite number of frequency points.The DFT of a sequence x(n) isX(k) = 102) (Nn N kn ie n x ; k = 0,1,2.N-1PROGRAM:RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONDEVELOPMENT OF THE PROGRAM FOR FINDING OUT DFT AND FFT USING TMS 320C6713 DSK PROCESSORBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: Development of the program for finding out DFT and FFT using TMS 320C6713 DSK ProcessorSOFTWARE: MATLAB 7THEORY:The discrete Fourier transform is a powerful computation tool which allows us to evaluate the Fourier transform X(ei) on a digital computer or specially designed digital hardware.The DFT is obtained by sampling one period of the Fourier transform at a finite number of frequency points.The DFT of a sequence x(n) isX(k) = 102) (Nn N kn ie n x ; k = 0,1,2.N-1MATLAB provides a function called fft to compute the DFT of a vector x. This fft function is written in machine language and not using MATLAB commands. Therefore it executes very fast . If N is a power of two, then a high speed radix- 2 FFT algorithm is employed . If N is not a power of two , then N is decomposed into prime factor and a slower mixed radix FFT algorithm is used . Finally if N is a prime number then the fft function is reduced to the row DFT algorithm .PROGRAM:To do by the student without using the function fft.RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONTO WRITE A PROGRAM AND SIMULATE USING C LANGUAGE / ASSEMBLY LANGUAGE FOR COMPUTATION OF LINEAR CONVOLUTION USING TMS 320C6713 DSK PROCESSORBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: To write a program and simulate using C language / assembly language for computation of Linear Convolution using TMS 320C6713 DSK ProcessorSOFTWARE: MATLAB 7THEORY:The linear convolution is used to obtain the response of an LTI system for any given input when its impulse response known . We can say that the input x(n) is convolved with the impulse the h(n) to produce the output y(n).The convolution sum is given byY(n) = x(n) * h(n) = K K n h K x ) ( ) (Involving four steps : Folding, Shifting, Multiplication & Summation.PROGRAM:RESULT:RESULT:PRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONTO WRITE A PROGRAM AND SIMULATE USING C LANGUAGE / ASSEMBLY LANGUAGE FOR COMPUTATION OF AUTO/ CROSS CORRELATION USING TMS PROCESSORBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: To write a program and simulate using C language / assembly language for computation of Auto/ Cross Correlation using TMS ProcessorSOFTWARE: MATLAB 7THEORY:Correlation is a measure of the degree to which two sequence are similar. Given two real-valued sequences x(n) & y(n) is a sequence xy() defined as nxy n y n x ) ( ) ( ) ( The index is called shift parameter . When x(n) = y(n), then the above equation defines autocorrelation as nxx n x n x ) ( ) ( ) ( PROGRAM:To develop by the students without making use of function x corr (x,y). Give imphasis on the use on the use of the conV_m functionPRECAUTIONS:DEPARTMENTOFELECTRONICS AND COMMUNICATIONDIGITAL SIGNAL PROCESSING LABORATORYLAB INSTRUCTIONS FOR CARRYING OUT PRACTICALONTO WRITE A PROGRAM AND SIMULATE USING C LANGUAGE / ASSEMBLY LANGUAGE FOR DESIGNING A DIGITAL FILTER (LP/ HP / BP / BR) USING TMS 320C6713 DSK PROCESSORBIRLA INSTITUTE OF TECHNOLOGYMESRA, RANCHIAIM: To write a program and simulate using C language / assembly language for designing a Digital Filter (LP/ HP / BP / BR) using TMS 320C6713 DSK ProcessorSOFTWARE: MATLAB 7.0THEORY:The Butterworth low pass filter has a magnitude response given by [ ]2 / 12) / ( 1) ( NcAi H + where A = Filter gain, c = 3dB cut off frequencyorder of filter N = ) / log(1111log 2 / 122P SAPAB 1111]1

,_

,_

Where AS = stop Band GainAP = Pass band GainS = Stop edge frequencyc = Pass edge frequencyand cut off frequency c = NSSA21112

,_

Poles for butterworth filter.SK = c exp[j(N+2K+1)/2N]Where K = 0,1,2,.N-1The Chebyshev Low pass filter has a magnitude response given by5 . 02) / ( 1) (2 cNC AH + where A = filter Gain = constantc = 3-dB cut off frequencyThe Chebyshev polynomial of the t kind of Nth order CN(x)= 1 ) cosh cosh(1 ) cos cos(n for fx N n for fx NThe magnitude response of the Chebyshev filter has passband & maximally flat passband. According to the response of filter that by increasing the filter order N, The Chebyshev response approximate the ideal response . The phase response of the Chebyshev filter in noise non-linear than the butterworth filter for given filter length N.The order of the filter is given by ( )) / ( cos1 / 11cosh12112P SSAN 1]1

where 21112 11]1

SA & c = P) 1 10 ( 2) 1 10 ( 2) / log( 2)] 1 10 /( ) 1 10 log[11log 1011log 10101010 1022

,_

,_

+

,_

,_

+ SPSpASCRPCS PARNcSSNcPPNNNARThe analog low pass filter is specified by the parameters P, S , AP & AS. Therefore the essence of the design in the case of Butterworth filter is to obtain the order N & the cutoff frequency C , given these specifications.PROGRAM:The above design procedure can be implemented in MATLAB as a simple function. To design by the students without making use of inbuilt function sfd butt.RESULT:PRECAUTIONS: