How to convolve two equations
이전 댓글 표시
I am trying to convolve two functions.
f(s) = (1-4s^2)^0.5
v(s) = sinc(s/pi)-0.5(sinc(s/2*pi))^2
I followed with entering in this:
w = conv(f,v,'full');
I keep getting an error. Would anyone know how to help? I'm not sure where I am going wrong?
댓글 수: 6
M
2017년 10월 31일
What is the error you get ? How do you define s ?
John D'Errico
2017년 10월 31일
There are a few potential problems here.
1. Sinc uses the Signal Processing Toolbox.
2. This is not valid MATLAB code:
v(s) = sinc(s/pi)-0.5(sinc(s/2*pi))^2
Multiplication requires an "*". Leaving it out will generate an error. So depending on whats is, you might have done this:
v = sinc(s/pi)-0.5*(sinc(s/2*pi))^2
If s is a vector, then you needed to use a dot operator, though scalar multiplication and division are ok with * and / alone.
v = sinc(s/pi)-0.5*(sinc(s/2*pi)).^2
Likewise, f has problems. Note that this relation only lives for real values on the interval [-0.5,0.5]. As well, you need to use dot operators again for vector s. And again, multiplication REQUIRES an *.
f = sqrt(1-4*s.^2);
3. Were you wanting to do a symbolic convolution?
Asima Warner
2017년 10월 31일
Asima Warner
2017년 10월 31일
Walter Roberson
2017년 10월 31일
Did you create
s = tf('s')
or using
syms s
? Either way, conv() is not valid for those.
Asima Warner
2017년 10월 31일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!