Question

Question: How to compute the convolution of these two signals in MatLa.. (1 bookmark) How to compute the convolution of these two signals in MatLab, without using the conv function/command System response: y(t)= 2tu(t)-3(t-1)u(t-1)-(t2)u(t-2) should be this one according to the books solutions. Suppose that the system of Figure P3.2(a) has the input x(t) given, in Figure P3.2(b). The impulse response is the unit step fund ion h(t)u(t). Find and sketch the system output y(t). h(0) x(t) 2 Figure P3.2

Just the program code please, thank you

0 0
Add a comment Improve this question Transcribed image text
Answer #1

x = input('Enter x: ');
h = input('Enter h: ') ;
Ni = length(x);
Nh = length(h);
y = zeros(1,Ni+Nh);
t = zeros(1,Nh);
for i = 1:Ni+Nh-1
if i<=Ni
t(1)= x(i);
for j = 1:Nh
y(i) = y(i) + h(j)*t(j);
end

for k = Nh:-1:2
t(k) = t(k-1);
end

else
t(1)= 0;
for j = 1:Nh
y(i) = y(i) + (h(j)*t(j));
end

for k = Nh:-1:2
t(k) = t(k-1);
end

end

end

stem(y);

Add a comment
Know the answer?
Add Answer to:
Just the program code please, thank you Question: How to compute the convolution of these two...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 9. MATLAB Problem: Use Matlab to find the convolution y(t) of f(t)2tu(t) and h(t) ut1u(t-1). You ...

    9. MATLAB Problem: Use Matlab to find the convolution y(t) of f(t)2tu(t) and h(t) ut1u(t-1). You should submit a printout of the matlab code as an m-file with comments (using %) explaining the role of each line. You should also submit a plot ofy(t) for-l sts 4. You may find Computer Example C2.4 on page 137 useful EXAMPLE FROM BOOK IS BELOW. System Response to External Input: The Zero-Sta 2.4 QComputer Example C2.4 Find c(t) = f(t) * g(t) for...

  • Help please! Problem No. P1: Convolution Below is a Matlab code for performing convolution of two...

    Help please! Problem No. P1: Convolution Below is a Matlab code for performing convolution of two sequences. function [y,ny] conv m(x,nx,h,nh) % Modified convolution routine for signal processing [y,ny] convolution result x,nx] first signal Dh,nh] second signal nyb nx(1)+nh(1); nye nx(length(x)) y-conv (x,h); Use the code to perform convolution of r) 1.2,3,4 and h( 3.2,1 nh (length(h));

  • A system has an input, x(t) and an impulse response, h(t). Using the convolution integral, find...

    A system has an input, x(t) and an impulse response, h(t). Using the convolution integral, find and plot the system output, y(t), for the combination given below. x(t) is P3.2(e) and h(t) is P3.2(f). 1/2 cycle of 2 cos at -2. (e)

  • Please provide MATLAB code and plot, about system response. Will thumbs up. Thanks. Question 1: MATLAB contains a built-...

    Please provide MATLAB code and plot, about system response. Will thumbs up. Thanks. Question 1: MATLAB contains a built-in function called conv which performs the convolution of two vectors: >> help conv conv Convolution and polynomial multiplication. C - conv(A, B) convolves vectors A and B. The resulting vector is length MAX ([LENGTH (A)+LENGTH (B)-1, LENGTH(A),LENGTH (B) 1) If A and B are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials. Compute the system response...

  • CONVOLUTION - Questions 4 and 5 4. Consider an LTI system with an impulse response h(n)...

    CONVOLUTION - Questions 4 and 5 4. Consider an LTI system with an impulse response h(n) = [1 2 1] for 0 <n<2. If the input to the system is x(n) = u(n)-un-2) where u(n) is the unit-step, calculate the output of the system y(n) analytically. Check your answer using the "conv" function in MATLAB. 5. Consider an LTI system with an impulse response h(n) = u(n) where u(n) is the unit-step. (a) If the input to the system is...

  • Analytically solve for the response y[t] of the system h[t]=2e‐10t for a pulse input x[t] of...

    Analytically solve for the response y[t] of the system h[t]=2e‐10t for a pulse input x[t] of width 1, 10 or 100 msec with its amplitude such that its width times its amplitude is equal to .1 a.) For each pulse, solve assuming it is an ideal impulse (i.e. use convolution integral) b.) solve not making this assumption (i.e. use convolution integral). c. ) Plot your results Matlab and also calculate the response using the conv command in Matlab.

  • Use MATLAB to compute the convolution as a sum ofechoes of the input signal x[n] = cos () with th...

    Use MATLAB to compute the convolution as a sum ofechoes of the input signal x[n] = cos () with the impulse response h[n]1.5un un - 6]) of an LTI system S. Is the output periodic? Why or why not? Please explain. Use MATLAB to compute the convolution as a sum ofechoes of the input signal x[n] = cos () with the impulse response h[n]1.5un un - 6]) of an LTI system S. Is the output periodic? Why or why not?...

  • I need help with this MATLAB exercise. The given system is y[n] - (3/10)y[n-1] - (1/10)y[n-2]...

    I need help with this MATLAB exercise. The given system is y[n] - (3/10)y[n-1] - (1/10)y[n-2] = 2x[n] The input x[n] is 2cos(2*pi*n/6)(u[n] - u[n-10]) Don't have to answer part 2 of the question. Zero-state response of a system can be found by using convolution of the input signal and unit impulse response: Use conv command from MATLAB to compute the zero-state response of the system defined in part B to the input x[n] in part C. 1. 2. 3....

  • Q4. Consider the two sequences x [n] = [0 otherwise h[n] = {00 otherwise α>1 calculate the convol...

    Q4. Consider the two sequences x [n] = [0 otherwise h[n] = {00 otherwise α>1 calculate the convolution of two signals. Q5. Consider an L'TI system with input x (o] and impulse response h (o] specified as follows. x [n] = 2"u [-n] h [n] -u [n] Find the output y [n] using convolution sum. Q4. Consider the two sequences x [n] = [0 otherwise h[n] = {00 otherwise α>1 calculate the convolution of two signals. Q5. Consider an L'TI...

  • please write code in MATLAB as well 5. (12 points) Create the following signal in Matlab:...

    please write code in MATLAB as well 5. (12 points) Create the following signal in Matlab: x[n] = u(n) - u[n-6] a. Mathematically compute yi[n] = x[n] * x[n] where * means convolution. Now use the conv command to perform the convolution. Graph x[n) and the resulting y(n), both over the interval Osns 20. How many non-zero terms does y(n) have? Does your computational result agree with the Matlab result? b. Repeat a. but this time with yz[n] = x[n]*h[n)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT