D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 1 VI SEMESTER B M S Institute of Technology & Management Yelahanka, Bengaluru - 64 Department of Electrical & Electronics Engineering VI SEMESTER CHOICE BASED CREDIT SYSTEM (CBCS) 17EEL68 Digital Signal Processing Laboratory LABORATORY MANUAL NAME OF THE STUDENT : BRANCH : UNIVERSITY SEAT NO. : SEMESTER & SECTION : BATCH : D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 2 VI SEMESTER Graduates of the program of Electrical and Electronics Engineering will, PEO1 * Have successful professional careers in Electrical Sciences, and I nformation Technology enabled areas and be able to pursue higher education. PEO2 Demonstrate ability to work in multidisciplinary teams and engage in lifelong learning. PEO3 Exhibit concern for environm ent and sustainable development. * Program Educational Objectives After the successful completion of the Program, the graduate will be able to, PO1: ** Engineering knowledge Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems. PO2: Problem analysis Identify, formulate, review research literature, and analyze complex engineer ing problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences. PO3: Design / development of solutions Design solutions for complex engineering problems and design system components or pr ocesses that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations. PO4: Conduct investigations of complex problems Use research - based knowledge and researc h methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions. PO5: Modern tool usage Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modeling to complex engineering activities with an understanding of the limitations. PO6: The engineer and society Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice. PO7: Environment and sustainability Understand the impact of the pro fessional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development. PO8: Ethics Apply ethical principles and commit to professional ethics and responsibilities and norms of the en gineering practice. PO9: Individual and team work Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings. PO10: Communication Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive c lear instructions. PO11: Project management and finance Demonstrate knowledge and understanding of the engineering and management principles and apply these to one’s own work, as a member and leader in a team, to manage projects and in multidisciplinary environments. PO12: Life - long learning Recognize the need for, and have the preparation and ability to engage in independent and life - long learning in the broadest context of technological change. ** Program Outcomes D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 3 VI SEMESTER Program Specific Outcomes: The Graduates of the Program will be able to PSO1: Analyze and design electrical power systems. PSO2: Analyze and design electrical machines. PSO3: Analyze and design power electronic controllers for industrial drives. PSO4: Analyze and design analog and digital electronic systems. Course Outcomes ( CO) At the end of the laboratory course the student will be able to: CO1 Analyse a system using difference equation or Impulse response CO2 Compute convolution, DFT/ IDFT of a given sequences using the basic definition and/or fast methods. CO3 Design and implement IIR and FIR filters CO4 Conduct experiments using software a package CO5 P repare reports that present laboratory work CO-PO-PSO mapping: PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO 4 CO1 3 3 1 3 CO2 3 3 2 3 CO3 3 3 1 3 CO4 3 3 2 3 CO5 3 3 D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 4 VI SEMESTER Sl. No. Name of the Experiment Page No. 1 Verification of Sampling Theorem both in time and frequency domains 2 Evaluation of impulse response of a system 3 Perform linear convolution of given sequences 4 To perform circular convolution of given sequences using (a) The convolution summation formula (b) The matrix method (c) Linear convolution from circular convolution with zero padding. 5 Computation of N – point DFT and to plot the magnitude and phase spectrum. 6 Linear and circular convolution by DFT and IDFT method. 7 Solution of a given difference equation. 8 Calculation of DFT and IDFT by FFT 9 Design and implementation of IIR filters to meet given specification (Low pass, high pass, band pass and band reject filters) 10 Design and implementation of FIR filters to meet given specification (Low pass, high pass, band pass and band reject filters) using diff erent window functions 11 Design and implementation of FIR filters to meet given specification (Low pass, high pass, band pass and band reject filters) using frequency sampling technique. 12 Realization of IIR and FIR filters D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 5 VI SEMESTER GUIDE LINES FOR THE EXPERIMENTS AND REPORT PREPARATION 1. Preparation for the experiment: Before conducting the experiment, the student is required to have read the experiment background and procedure from the experiment manual and studied the related theory. The lab instructor may, during the experiment, ask students questions pertaining to the procedure and theory. The lab instructor may give negative points to and even prevent an unprepared student from conducting the experiment. Tardy students may not be allowed to perform the experiment. 2. Laboratory teams: The class will be divided in teams of three or four students. The composition of the teams (which students will team up) is decision of Lab Instructor. Each lab experiment requires a report. The lab reports are due on the next lab meeting. The lab report for the final experiment is due a week after the final lab meeting. Each student submits one report per experiment (unless otherwise required) in the record. The grade of the report is given to all members of the team. Late reports are penalized by taking 5 points off per each day past the due date of the report. The other grade components of the experiments are given to the students individually. If a student misses or is dismissed from an experiment, the grade of that student shall be zero for that experiment. 3. Preparation of the report: The report must be produced in the lab Records of the Institute. Tables showing data or results, as well as figures and graphs should be produced. Include captions and titles for figures, graphs and tables as well as numbers for equations. The preferred language style is the use of the present tense and third person. The report must contain the following sections: Cover page: Include number and title of the experiment, date the experiment was performed and the names of the team members. Objective: Give a short description of the purpose of the experiment. Theoretical background: Give a brief description of the relevant theory. The experimental procedure: Summarize what was done for each experiment procedure. Do not copy or repeat the description from the lab manual. Report the measurement and other experimental data. Tabulate measurements if necessary. Include table number and title over tables. Analysis of experimental data: Analyze the data. Compare with theoretical results. Label axis. Show units. Add remarks and calculations on each procedure if necessary. Conclusions: Summarize the experiment and the results. Discuss the factual knowledge gained. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 6 VI SEMESTER Experiment 1: Aim: Verification of Sampling Theorem, both in time and frequency domain Theory: The sampling theorem states that, if the sampling rate in any pulse modulation system exceeds twice the maximum signal frequency, the original signal can be reconstructed in the receiver with minimal distortion. The sampling theorem is used in practice to determine minimum sampling speeds. Consider pulse modulation used for speech. Transmission is generally over standard telephone channels, so that the audio frequency range is 300 to 3400 Hz. For this application, a sampling rate 8000 samples per second is almost a worldwide standard. This pulse rate is, as can be seen, comfortably more than twice the highest audio frequency. The sampling theorem is satisfied, and the resulting system is free from sampling error. According to the Nyquist criterion, the sampling frequency, Fs, must be at least twice the maximum frequency component in the signal. If this criterion is violated, a phenomenon known as aliasing occurs. The figure below shows an adequately sampled signal and an under sampled signal. In the under sampled case, the result is an aliased signal that appears to be at a lower frequency than the actual signal. When the Nyquist criterion is violated, frequency components above half the sampling frequency appear as frequency components below half the sampling frequency, resulting in an erroneous representation of the signal. For example, a component at frequency appear as the frequency F s - f 0 The following figure shows the alias frequencies that appear when the signal with real components at 25, 70, 160, and 510 Hz is sampled at 100 Hz. Alias frequencies appear at 10, 30, and 40 Hz. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 7 VI SEMESTER Before a signal is digitized, you can prevent aliasing by using anti-aliasing filters to attenuate the frequency components at and above half the sampling frequency to a level below the dynamic range of the analog-to-digital converter (ADC). For example, if the digitizer has a full- scale range of 80 dB, frequency components at and above the half of the sampling frequency must be attenuated to 80 dB below full scale. These higher frequency components do not interfere with the measurement. If you know that the frequency bandwidth of the signal being measured is lower than half the sampling frequency, you can choose not to use an anti-aliasing filter. (Theory Source: http://www.ni.com/white-paper/5509/en/) The MATLAB Code for verifying Sampling Theorem: % Experiment 1 : Sampling Theorem Verification clear all; close all; clc; % Create a composite signal having many frequencies f1 = 1000; % Signal 1 Frequency = 1 kHz f2 = 1900; % Signal 2 Frequency = 1.9 kHz f3 = 500; % Signal 3 Frequency = 0.5 kHz all_f = [f1 f2 f3]; % extend with other entries if needed fmax = max(all_f); % Maximum frequency component of signal T = 1/min(all_f); % Signal Period should cover entire length t = 0:0.01*T:2*T; % Time index % Generate the composite signal and plot it: x = cos(2*pi*t*f1)+ cos(2*pi*t*f2)+ cos(2*pi*t*f3); % Composite Signal subplot(2,2,1); plot(t,x); grid on; title('The Composite Signal'); xlabel('t'); ylabel('x(t)'); % Oversampling the signal fs1 = 20*fmax; % Oversampling (fs > 2f) n1 = 0:1/fs1:2*T; % Time scale x1 = cos(2*pi*f1*n1)+ cos(2*pi*f2*n1)+ cos(2*pi*f3*n1); % Generating sampled signal subplot(2,2,2); stem(n1,x1); hold on; D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 8 VI SEMESTER plot(n1,x1,'r'); grid on; hold off; title('Oversampled and Reconstructed Signal: fs = 10fmax'); xlabel('n'); ylabel('x(n)'); % Sampling the signal just to meet the Nyquist Criterion fs2 = 2*fmax; % Nyquist Sampling (fs = 2f) n2 = 0:1/fs2:2*T; x2 = cos(2*pi*f1*n2)+ cos(2*pi*f2*n2) + cos(2*pi*f3*n2); subplot(2,2,3); stem(n2,x2); hold on; plot(n2,x2,'r'); grid on; hold off; title('Sampled and Reconstructed at Nyquist Frequency : fs = 2*fmax'); xlabel('n'); ylabel('x(n)'); % Under Sampling the signal fs3 = 1.2*fmax; % Undersampling (fs < 2f) n3 = 0:1/fs3:2*T; x3 = cos(2*pi*f1*n3)+ cos(2*pi*f2*n3)+ cos(2*pi*f3*n3); subplot(2,2,4); stem(n3,x3); hold on; plot(n3,x3,'r'); grid on; hold off; title('Undersampled and Reconstructed Signal: fs = 1.2*fmax'); xlabel('n'); ylabel('x(n)'); The Results of running the code is shown in the following image window. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 9 VI SEMESTER Task: 1. Create composite signals for different frequencies and verify the sampling theorem. 2. Plot the each of the signals viz. composite signal, samples taken, and reconstructed signals separately for each case of sampling. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 10 VI SEMESTER Experiment 2: Aim: To determine the Impulse Response of a system Theory: From the expressions for output of a system as given below, we can conclude that the characteristics of an LTI system are completely determined by its impulse response. The representation of output of a discrete time takes the form of the convolution sum, while it’s continuous time counterpart is the convolution integral. For Discrete time: , - , - , - ∑ , - , - ......................(1) For Continuous time: ( ) ∫ ( ) ( ) ...................(2) Impulse response is the system’s response (output) to an impulse input: h*n+ ≡ y*n+, when input x*n+=δ*n+ . i.e., δ*n+ → LTI → h*n+ For example, consider a system described by the difference equation, y[n] = 0.5 y*n − 1+ + x*n+ The impulse response h*n+ can be computed recursively from y*n+ by setting x*n+ = δ*n+. If the input is an impulse x*n+ = δ*n+ And, y*−1+ = 0 (zero-state), then, the response y[n] will be, y[0] = x[0] = 1 y[1] = 0.5y[0] + 0 = 0.5 y[2] = 0.5y[1] = 0.25 y[3] = 0.5y[2] = 0.125 , . . .. Thus the impulse response is h[n] = 0.5 n u[n]. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 11 VI SEMESTER The given system has to be represented in the form of a vector with all coefficients of the inputs and outputs. The same must then be given to the program, to determine the impulse response or step response. Alternatively, the LTI system is represented in terms of the inputs and outputs as follows: , - ∑ ( ) ∑ ( ) The a k and b k are the coefficients of the given system. Let us take an example of determining and plotting the impulse response from a system described by the following difference equation: y[n] – 1.143*y[n-1] + 0.4128*y[n-2] = 0.0675*x[n] + 0.1349*x[n-1] + 0.675*x[n-2] The coefficients of y(n) are collectively represented as a = [1 -1.143 0.4128] Similarly, the coefficients of present and past inputs x(n) are collectively represented as b = [0.0675 0.1349 0.675] The MATLAB has a built- in function ‘impz’ to determine the impulse response. [h, t] = impz(b,a,25); Comment : The third argument 25 forces the impz function to determine 25 samples of the output. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 12 VI SEMESTER MATLAB CODE: % Experiment 2: Determining the Impulse Response of a system and plotting the same clear all; close all; clc; % Accept Input and Output signal Co-efficients: b = input('Enter the coefficients of inputs x(n): '); a = input('Enter the coefficients of outputs y(n): '); N = input('How many samples are required in the h(n)? '); [h,t] = impz(b,a,N); %Plot and Display impulse response co-efficients: stem(t,h); title('Impulse Response of the system'); ylabel('h(n)'); xlabel('Sample, n'); disp('Impulse Response Coefficients:'); disp(h); D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 13 VI SEMESTER Task: 1. Determine the step response of the system and plot the same. (Hint: Use ‘ stepz(b,a,25) ’ for determining the step response ) 2. Determine the impulse- and step response from a system described by the following difference equation: y[n] – 0.85*y[n-1] = 0.25*x[n-1] + 0.675*x[n-2] Make a m-file that gives both the impulse- and step response for the first 25 samples. Are there any conclusions that can be drawn from the transient responses, regarding the stability and final values ? Assume zero initial conditions. 3. Create an m-file that produces the following signals. Use subplots or pause command to separate the signals from each other in time and plot window. a) Create a step function with a step amplitude 3 and with a step appearing after 10.5 seconds. b) Create an impulse function at time t=4.6 sec and a amplitude 3. c) Create a ramp function with a slope 3. The ramp starts after 2.5 seconds. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 14 VI SEMESTER Experiment 3: Perform linear convolution of given sequences Aim: To perform the linear convolution of the given signals / sequences Theory: Convolution, one of the most important concepts in electrical engineering, can be used to determine the output a system produces for a given input signal. It can be shown that a linear time invariant system is completely characterized by its impulse response. The sifting property of the discrete time impulse function tells us that the input signal to a system can be represented as a sum of scaled and shifted unit impulses. Thus, by linearity, it would seem reasonable to compute of the output signal as the sum of scaled and shifted unit impulse responses. That is exactly what the operation of convolution accomplishes. Hence, convolution can be used to determine a linear time invariant system's output from knowledge of the input and the impulse response. MATLAB CODE: 3.1 Without using the MATLAB built- in function ‘conv’ % Experiment 3.1: To find perform convolution of two signals with out uisng % the built-in function, 'conv' clear all; clc; x = input('Enter the first signal/sequence '); h = input('Enter the second signal/sequence '); % Find the length of the individual signals, and thus the output [~,L] = size(x); [~,M] = size(h); len_y = L + M -1 y = zeros(1,len_y); len = 1:len_y; for i = 0:len_y for j = 0:len_y if ((i-j+1)>0 && (i-j+1)<=M && (j+1)<=L) y(i+1) = y(i+1)+ x(j+1).* h(i-j+1); end end end disp(y) stem(len,y) OUTPUT: For inputs x = [1 2 1] and h = [ 1 2 3 4], the output will be y = [1 4 8 12 11 4 ] , as displayed in the stem plot below: D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 15 VI SEMESTER MATLAB CODE: 3.2 Convolution using the built- in function ‘conv’ % Experiment 3.1: To find perform convolution of two signals uisng % the built-in function, 'conv' clear all; clc; x = input('Enter the first signal/sequence '); h = input('Enter the second signal/sequence '); sprintf('\n') disp('The convolution of the above sequences is:') y_matlab_conv = conv(x,h); disp(y_matlab_conv) stem(y_matlab_conv) D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 16 VI SEMESTER Tasks: 1. Find the convolution of the two signals [1, -3, 4, 4] and [ 3 , 2, 3, 7, 3, -2] 2. Find the convolution of the two signals [1.4, 4.5, -8.1, 1.0] and [ 5.0, 2.3, -1.2, -5.6, 4.1] 3. Obtain the linear convolution of the above signals using the FFT and compare the results. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 17 VI SEMESTER Experiment 4: Circular Convolution Aim A: To perform circular convolution of given two signals Theory: For a numerical implementation of the convolution operation to be practical, the signals, say x(k) and h(k) must be finite. Suppose h(k) is defined for all k, but nonzero only for 0 ≤ k < L. Similarly, let x(k) be a signal that is nonzero for 0 ≤ k < M. Th en the linear convolution can be expressed as shown before. Generate two signals of different lengths. Compare their circular convolution and their linear convolution. Use the default value for n. a = [1 2 -1 1]; b = [1 1 2 1 2 2 1 1]; c = cconv(a,b); % Circular convolution cref = conv(a,b); % Linear convolution dif = norm(c-cref) % Difference between the two The resulting norm (dif = 9.7422e-16) is virtually zero, which shows that the two convolutions produce the same result to machine precision. Circular convolution contains same number of samples as that of input x(k) and h(k). Where as in linear convolution the number of samples increases and to get the length of result we use the equation N + L – 1. That’s why the result of linear and circular convolution doesn’t match. Some important points to be considered: 1. The circular convolution is defined on time-limited sequences of length N. 2. The circular convolution is periodic with period N. 3. In the circular convolution, the shifted sequence wraps around the summation window, when it would leave the region. 4. In the finite discrete domain , the convolution theorem holds for the circular convolution , not for the linear convolution. Linear convolution can be obtained by appropriate zero-padding of the sequences. D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 18 VI SEMESTER MATLAB CODE: 4.1 Circular Convolution without using the MATLAB built- in function ‘cconv’ clc; clear all; Seq1 = input('Enter the first sequence = '); Seq2 = input('Enter the second sequence = '); Len1 = length(Seq1); Len2 = length(Seq2); Max_Len = max(Len1,Len2); Diff_Len = Len1-Len2; if(Diff_Len>=0) Seq2 = [Seq2,zeros(1,Diff_Len)]; else Seq1 = [Seq1,zeros(1,-Diff_Len)]; end%circular shifting and convolution for n = 1:Max_Len y(n) = 0; for i = 1:Max_Len j = n-i+1; if(j<=0) j = Max_Len+j; end y(n) = [y(n)+Seq1(i)*Seq2(j)]; end end %plot the inputs and output n = 0:Max_Len-1; subplot(3,1,1); stem(n,Seq1); grid on; title('First Sequence'); subplot(3,1,2); stem(n,Seq2); grid on; title('Second Sequence'); subplot(3,1,3); disp('Convolved Sequence = '); disp(y); stem(n,y); grid on; title('Convolved Output'); D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 19 VI SEMESTER D D E EP PA AR RT TM ME EN NT T O O F F E EL LE EC CT TR RI IC CA AL L & & E EL LE EC CT TR RO ON NI IC CS S E EN NG GI IN NE EE ER R I IN NG G B BM MS SI IT T& &M M DSP LAB - 17EEL68 20 VI SEMESTER Experiment 4.1: Circular Convolution (Contd.) Aim A: To perform circular convolution of given two signals by Matrix Method Theory: There is a matrix formulation for the of Circular Convolution. Let h and y be the N X 1 column vectors containing the samples of h(k) and y(k) = h(k) ⊗ x(k). h = [ h(0), h(1, h(2),......... h(N – 1)] T y = [y (0), y(1, y(2),......... y(N – 1)] T Since circular convolution is a linear transformation from h to y, it can be represented by an N X N matrix C(x). An example of N = 5 as a case is given below: C(x) = [ ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )] Observe that the rows of circular convolution matrix C(x) are just rotated version of x(-i). Using the above information, the circular convolution can be expressed as: y = C(x) h As an illustration, Let h = [ 7, 5, -3] and x = [ 6, 8, -2], each of length N = 3. Thus, y = C(x) h = [ ] [ ] = , - T