Convolution, discrete time (not using conv)

Write a MATLAB routine that generally computes the discrete convolution between two discrete signals in time-domain. (Do not use the standard MATLAB “conv” function.) • Apply your routine to compute the convolution rect( t / 4 )*rect( 2 t / 3 ).

댓글 수: 2

umar
umar 2011년 12월 18일
If i use below coding, how to put rect(t/4) and rect(2t/3)in x and h? Please can anyone answer this?
% A GENERALAZED CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT USING MATLAB BUILTIN FUNCTION conv(x,h)
close all
clear all
x=input('Enter x: ')
h=input('Enter h: ')
m=length(x);
n=length(h);
X=[x,zeros(1,n)];
H=[h,zeros(1,m)];
for i=1:n+m-1
Y(i)=0;
for j=1:m
if(i-j+1>0)
Y(i)=Y(i)+X(j)*H(i-j+1);
else
end
end
end
Y
stem(Y);
ylabel('Y[n]');
xlabel('----->n');
title('Convolution of Two Signals without conv function');
Friðrik Hover
Friðrik Hover 2016년 2월 21일
Running this code and and also the built in conv function to convolute two signals makes the x axis wrong. How do you fix that?

댓글을 달려면 로그인하십시오.

답변 (2개)

Naz
Naz 2011년 12월 17일

0 개 추천

just implement the equation http://en.wikipedia.org/wiki/Convolution#Circular_discrete_convolution and use sum from 1 to N instead of 0 to N-1

댓글 수: 4

umar
umar 2011년 12월 17일
that is for calculation right? How to make a coding in matlab?
Wayne King
Wayne King 2011년 12월 17일
I think Naz has given you some direction here, but you have just posted your homework problem. If you show what you have coded in trying to solve your homework problem, people are generally more helpful.
umar
umar 2011년 12월 17일
to be honest. We are taking signal course. We do not learn about MATLAB in this course. Actually, i do not have any idea how to start.
yuki kim
yuki kim 2017년 4월 2일
me too...

댓글을 달려면 로그인하십시오.

sahiba tasneem
sahiba tasneem 2017년 7월 24일

0 개 추천

Can u plz describe the code

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2011년 12월 17일

답변:

2017년 7월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by