Hi guys,
My question can be a little bit stupid but im trying to figure it out why the answer of my convolution isn't working. The results should appear in the n=0 and this is not what im getting.
Can someone tell me how can i solve it?
The sequence is:
x=[-1 0 1]
h= [0.5 0.25 0.125] ->(version not flipped by the way)
i should get for n=0 ==> -0.5
Cheers!

댓글 수: 2

Image Analyst
Image Analyst 2017년 9월 10일
편집: Image Analyst 2017년 9월 10일
If n is the number of samples, as you said, then what does it mean when you say n=0? Zero samples????
n is not the number of samples. In discrete convolution, n is a array index.

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

 채택된 답변

Jose Marques
Jose Marques 2017년 9월 9일
Hello Jucimar. You can try this:
x = [-1 0 1];
h = [0.5 0.25 0 0.125];
w = conv(x,h)
w =
Columns 1 through 5
-0.5000 -0.2500 0.5000 0.1250 0
Column 6
0.1250

댓글 수: 4

For n = 0, the element will be w(1) = -0.5
Hi Jose, so basic i can't have the graphic showing the (n=0) with the amplitude of -0.5 ?
You can generate a array n:
x = [-1 0 1];
h = [0.5 0.25 0 0.125];
n = 0:5;
w = conv(x,h)
plot(n,w)
Try this.
Thats nice!!!, thank you a lot!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

태그

질문:

2017년 9월 9일

댓글:

2017년 9월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by