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

02.convolve 2 Signals

This document contains MATLAB code to perform a convolution operation on two sequences. It defines input and impulse sequences, performs the convolution using the conv function, and plots the input, impulse response, and output sequences.

Uploaded by

Barath
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

02.convolve 2 Signals

This document contains MATLAB code to perform a convolution operation on two sequences. It defines input and impulse sequences, performs the convolution using the conv function, and plots the input, impulse response, and output sequences.

Uploaded by

Barath
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

clc;

clear all;
close all;
x = [0,2.5,4.7,6.5,7.6];
N1=length(x);
N=0:1:N1-1;
subplot(2,2,1);
stem(N,x);
xlabel('x(n)');
ylabel('x(n)');
title('input signal x(n)');
h = [8,7.6,6.5,4.7,2.5];
N2 = length(h);
n1 = 0:1:N2-1;
subplot(2,2,2);
stem(n1,h);
xlabel('x(n)');
ylabel('h(n)');
title('impulse signal h(n)');
y=conv(x,h);
n2 = 0:1:N1+N2-2;
subplot(2,2,3);
stem(n2,y);
xlabel('n');
ylabel('y(n)');
title('convolve of two seq x(h) and h(n)')

You might also like