0% found this document useful (0 votes)
37 views

Exp 5

This program writes code to find the response of convolving an exponential signal with an impulse response without using the conv() function. It defines the impulse response h and exponential signal x. It then uses a for loop to calculate the convolution signal r by multiplying and summing values from h and x based on their time indices. Finally, it verifies the results by convolving h and x with the conv() function and plotting both convolution signals on the same axes.

Uploaded by

JatinKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Exp 5

This program writes code to find the response of convolving an exponential signal with an impulse response without using the conv() function. It defines the impulse response h and exponential signal x. It then uses a for loop to calculate the convolution signal r by multiplying and summing values from h and x based on their time indices. Finally, it verifies the results by convolving h and x with the conv() function and plotting both convolution signals on the same axes.

Uploaded by

JatinKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment No.

5
Aim: Write a program to find the response of given exponential signal using
convolution without using conv() function
Code for Convolution
close all
clear all
t = 0:10 ;
h = [ones(1,11)] ;
a = length(h) ;
figure(1)
stem(t,h), title('Impulse Response') ;
t1 = 0:10 ;
x = exp(t1) ;
b = length(x) ;
figure(2)
stem(t1,x), title('Exponential Signal') ;
r = zeros(a+b-1) ;
for n=1:(a+b-1)
for k=1:b
if (n-k+1>0)&&(n-k+1<=b)
r(n)= r(n) + x(k).*h(n-k+1);
end
end
end
z = (min(t)+min(t1)):(max(t)+max(t1)) ;
figure(3)
stem(z,r), title('Convolution Signal') ;
% Verification Using conv() function
i = conv(h,x);
figure(4)
stem(z,i), title('Verification Using Conv() function') ;

You might also like