convolution integral of two continious time signals

i need to evaluate the convolution between ( [ 0.5*( (a)^n ) + 0.5*( (-a)^n ) ] )*u[n] and ( u[n] – u[n-50] ). i tried to write a code by the help of another post but couldn’t. The code is
syms n;
a = sqrt(b);
h(n) = (0.5*((a)^n) + 0.5*((-a)^n))*heaviside(n)
hcal(0,a);
x=0;
while (ans>0.01)
x = x+2;
hcal(x,a);
end
fprintf(‘The sallest n is %.fn’,x)
n = [-2:1:17];
stem(n,h(n));
%%rest of the code is the part that i wrote by help
jfun= @(n)(1.*( (n>=4) – (n>=6) ) );
lfun= @(n)( (0.5*((a)^n) + 0.5*((-a)^n)).*(n>=0))
tt = [1:1:50];
cint=0*tt;
for ii = 1:length(tt)
cfun = @(q,n)(jfun(q).*lfun(n-q));
cint(ii) = integral(@(q)cfun(q,tt(ii)),0,tt(ii));
end
zz1 = conv(jfun(tt),lfun(tt))*tt(2);
stem(tt,cint,’-x’,(0:length(zz1)-1)*tt(2),zz1)
end
What is/are my mistake(s)?i need to evaluate the convolution between ( [ 0.5*( (a)^n ) + 0.5*( (-a)^n ) ] )*u[n] and ( u[n] – u[n-50] ). i tried to write a code by the help of another post but couldn’t. The code is
syms n;
a = sqrt(b);
h(n) = (0.5*((a)^n) + 0.5*((-a)^n))*heaviside(n)
hcal(0,a);
x=0;
while (ans>0.01)
x = x+2;
hcal(x,a);
end
fprintf(‘The sallest n is %.fn’,x)
n = [-2:1:17];
stem(n,h(n));
%%rest of the code is the part that i wrote by help
jfun= @(n)(1.*( (n>=4) – (n>=6) ) );
lfun= @(n)( (0.5*((a)^n) + 0.5*((-a)^n)).*(n>=0))
tt = [1:1:50];
cint=0*tt;
for ii = 1:length(tt)
cfun = @(q,n)(jfun(q).*lfun(n-q));
cint(ii) = integral(@(q)cfun(q,tt(ii)),0,tt(ii));
end
zz1 = conv(jfun(tt),lfun(tt))*tt(2);
stem(tt,cint,’-x’,(0:length(zz1)-1)*tt(2),zz1)
end
What is/are my mistake(s)? i need to evaluate the convolution between ( [ 0.5*( (a)^n ) + 0.5*( (-a)^n ) ] )*u[n] and ( u[n] – u[n-50] ). i tried to write a code by the help of another post but couldn’t. The code is
syms n;
a = sqrt(b);
h(n) = (0.5*((a)^n) + 0.5*((-a)^n))*heaviside(n)
hcal(0,a);
x=0;
while (ans>0.01)
x = x+2;
hcal(x,a);
end
fprintf(‘The sallest n is %.fn’,x)
n = [-2:1:17];
stem(n,h(n));
%%rest of the code is the part that i wrote by help
jfun= @(n)(1.*( (n>=4) – (n>=6) ) );
lfun= @(n)( (0.5*((a)^n) + 0.5*((-a)^n)).*(n>=0))
tt = [1:1:50];
cint=0*tt;
for ii = 1:length(tt)
cfun = @(q,n)(jfun(q).*lfun(n-q));
cint(ii) = integral(@(q)cfun(q,tt(ii)),0,tt(ii));
end
zz1 = conv(jfun(tt),lfun(tt))*tt(2);
stem(tt,cint,’-x’,(0:length(zz1)-1)*tt(2),zz1)
end
What is/are my mistake(s)? convolution, singal_convolution MATLAB Answers — New Questions

​

Leave a Reply

Your email address will not be published. Required fields are marked *