Question

In: Electrical Engineering

Topic: Introduction to Convolution Software used : Matlab Course : Signal and Systems Lab 1. a)...

Topic: Introduction to Convolution

Software used : Matlab

Course : Signal and Systems Lab

1.

a) Make the flowchart or pseudo code for convolution.

b) Implement convolution in MATLAB.

   Hint: Make a function using the format: function result = myconv (a,b)

            Where a and b are input matrix and result is convolution answer.

c) Compare it with conv command.

2. Let input signal x be [1, 3, –2, 4, -1] and the system h be [-2, 3, 4, –3, 6]. Find the output of the system y using the conv command.

3. Now suppose we add another system j = [3, –1, 2, 4, 1] in series with the above system. Now find the overall response and output y of the above system using the conv command. Hint: The systems h and j should be convolved first and then the resultant should be convolved with x to get the overall response.

4. Again suppose now j is attached in parallel to h. Now find the impulse response y for the system.

5. Now suppose the two systems h and j are again in series and a third system k = [2, 3, 4, 5, 6] has also been attached with them in parallel. Find the impulse response of the overall system and hence the output y. Hint: You will have to make sure that the size of the system k be made equal to the resultant of the size of the system obtained by convolving the systems h and k that are attached in series.

Up until now we have supposed that all signals starting point is same say 0. Now suppose the system h starting point is –2, that of system j is 0 and that of system k is 3. Now handle this situation carefully and get the overall impulse response of the system and hence the output y. Also please draw stem plot of each of system including the input x, systems, h, j, k, the overall response and finally the output y.

6. Write a program without using conv command and for loop to convolve two arbitrary length signals. (Hint: Use toeplitz command)  

Solutions

Expert Solution

1.

(a).

Pseudo-code for convolution:

  • Store the input signal as a 1xN vector a
  • Store the impulse response of the system as a 1xM vector b
  • Transpose the impulse response or the input signal
  • Multiply them to construct an NxM or MxN matrix P
  • add P(i,(i-j)
  • represent in a vector form c

(b).

MatLab Code:

function c = myconv(a,b)
m=length(a);
n=length(b);

P=a(1,:)*b(1);
for i= 2:m
P=[P;a(1,:).*b(i)];
end


c=zeros(1,n+m-1);
for i = 1:n
c=c+[zeros(1,i-1) P(i,:) zeros(1,m-i)] ;
end
disp('Manual Result')
c
disp('conv command result')
conv(a,b)

Testcase:

(2).

>> x=[1, 3, -2, 4, -1];
>>h=[-2, 3, 4, -3, 6];
>> myconv(x,h);

Output:

Manual Result

c =

-2 -3 17 -5 3 37 -28 27 -6

conv command result

ans =

-2 -3 17 -5 3 37 -28 27 -6

(3).

When another system is added in series the impulse responses are multiplied in the Laplace domain and convolved in the time domain to get overall impulse response.

Test case:

>> x=[1, 3, -2, 4, -1];
>>h=[-2, 3, 4, -3, 6];

>> j = [3, -1, 2, 4, 1];
>> h1=conv(h,j);

>>conv(x,h1)

Output:

ans =

-6 -7 50 -46 34 163 -118 190 50 -15 68 3 -6

(4).

When two systems are attached parallel the impulse responses are added:

Test case:

>> x=[1, 3, -2, 4, -1];
>>h=[-2, 3, 4, -3, 6];

>> j = [3, -1, 2, 4, 1];
>> h2=h+j;

>>conv(x,h2)

Output:

ans =

1 5 10 19 5 41 -16 27 -7


Related Solutions

Course: Introduction to software engineering Task Auction systems are a major component of the electronic marketplace...
Course: Introduction to software engineering Task Auction systems are a major component of the electronic marketplace that allow users at any site to sell and buy products. The sellers set up auctions for their products while the purchaser who bids the highest amount wins the right to purchase the product in an auction. Prepare you own assumption for your eAuction, which can be B2B or B2C. AIT Dev Center has been contact from client to develop an eAuction system. However,...
Realize signal processing systems described by the difference equation: ?1(?)=1/2 [?(?)+?(?−1)] and ?2(?)=1/2 [?(?)−?(?−1)] using Matlab....
Realize signal processing systems described by the difference equation: ?1(?)=1/2 [?(?)+?(?−1)] and ?2(?)=1/2 [?(?)−?(?−1)] using Matlab. Assuming same input signal x(n)=sin(ωn) for various values of ω ={0,p/6 ,3p/2, 1.9p/2} applied to both systems find the following: a. Obtain stem plots and codes of y1(n) and y2(n) in each . b. Critically analyze y1(n) and y2(n) in terms of type of filter, maximum gain and cut off frequency. (Hint : The system can be tested by computing frequency response of the...
By using MATLAB 1. Divide a speech signal or music signal into frames of size N...
By using MATLAB 1. Divide a speech signal or music signal into frames of size N = 64. 2. Compute the N?point DFT of each frame. 3. Save only first L = 20 DFT coefficients. 4. Reconstruct the frame from these L coefficients. (Do not disturb the symmetry of DFT during inverse DFT computation. X[k] = X[N ?k] for real signals, N = 64 here. Pad zeros for missing DFT coefficients.) 5. Comment on the quality of reconstructed and the...
Infocomp Systems Lab is a research and development (R&D) company that develops computer systems and software...
Infocomp Systems Lab is a research and development (R&D) company that develops computer systems and software primarily for the medical industry. The lab has proposals from its own researchers for eight new projects. Each of the proposed research projects requires limited resources, and it is not possible to undertake all of them. The following table shows the developmental budget, the number of researchers, and the expected annual sales from each project if successfully developed and implemented: Project Developmental Budget ($1,000,000s)...
Lab 1: Measurements and uncertainty estimation Introduction: The purpose of this lab is to measure a...
Lab 1: Measurements and uncertainty estimation Introduction: The purpose of this lab is to measure a quantity related to the static friction of glass. Static friction is the force required to start moving an object from rest. You will place a coin on the glass and lift one end until the coin begins to move. Your goal is to measure the angle at which the coin moves and understand what affects the precision and accuracy of your measurements. 1) Pick...
Software Project Management course q- write a report on the topic is Resource Management? I need...
Software Project Management course q- write a report on the topic is Resource Management? I need information about this topic (Resource Management)  
Using Matlab Simulink, find Fourier transform of the following signal; ?(?) = 2 + ∑ 1...
Using Matlab Simulink, find Fourier transform of the following signal; ?(?) = 2 + ∑ 1 ? sin (20???) 4 ?=1 . Set simulation stop time = 20 seconds, sample time = (1/1024) seconds, buffer size =1024, and frequency range in Hz for the vector scope is −100 ≤ ? ≤ 100
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to...
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to for example OFDM system, AMR reading using gprs etc. Or any communication systems related topic. Can some one provide with the brief project description and MATLAB code?
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to...
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to for example OFDM system, AMR reading using gprs etc. Or any communication systems related topic. Can some one provide with the brief project description and MATLAB code?
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to...
I am supposed to do a communication systems project including MATLAB. Topic maybe something related to for example OFDM system, AMR reading using gprs etc. Or any communication systems related topic. Can some one provide with the brief project description and MATLAB code?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT