Name Jaspreet Kaur Roll No. A06 Registration 11100246 Practical-2 Write A Programme For The Convolution of Two Signals
This document contains the details of a student named Jaspreet Kaur with roll number A06 and registration number 11100246. It describes a program written to calculate the convolution of two signals, x=[1 2 3 4] and h=[5 6 7 8]. The program defines the length of the convolved signal, pads the two signals with zeros, initializes the output array, and uses a nested for loop to calculate the convolution sum and output signal y at each interval. It then plots the input, impulse response and convolved signals.
Name Jaspreet Kaur Roll No. A06 Registration 11100246 Practical-2 Write A Programme For The Convolution of Two Signals
This document contains the details of a student named Jaspreet Kaur with roll number A06 and registration number 11100246. It describes a program written to calculate the convolution of two signals, x=[1 2 3 4] and h=[5 6 7 8]. The program defines the length of the convolved signal, pads the two signals with zeros, initializes the output array, and uses a nested for loop to calculate the convolution sum and output signal y at each interval. It then plots the input, impulse response and convolved signals.
y=zeros(1,n) sum=0 subplot(311),stem(x),xlabel('input signal-1 at differnt intervals'),ylabel('amplitude of signal-1') subplot(312),stem(h),xlabel('input signal-2 at differnt intervals'),ylabel('amplitude of signal-2') y=zeros(1,n) sum=0 for i=1:n sum=0 for j=1:i sum=sum+x1(j)*h1(i-j+1) end y(i)=sum subplot(313),stem(y) ,xlabel('convolution of signal 1&2 at differnt intervals'),ylabel('amplitude of convolved signals')