How to convolve two equations
Mostrar comentarios más antiguos
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 comentarios
M
el 31 de Oct. de 2017
What is the error you get ? How do you define s ?
John D'Errico
el 31 de Oct. de 2017
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
el 31 de Oct. de 2017
Asima Warner
el 31 de Oct. de 2017
Walter Roberson
el 31 de Oct. de 2017
Did you create
s = tf('s')
or using
syms s
? Either way, conv() is not valid for those.
Asima Warner
el 31 de Oct. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Numbers and Precision en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!