Info

This question is closed. Reopen it to edit or answer.

Convolution Capabilities in MATLAB

1 view (last 30 days)
Paige Coffeen
Paige Coffeen on 13 Mar 2018
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello!
I have 2 discrete signals that I have entered into MATLAB and successfully gotten a graph of the convolution of the two. I’m wondering if MATLAB is capable of turning this into an output function. Currently I have h(n)=1 for n=0:9 and x(n)=3.*n.*heaviside(-n) both plotted on a stem graph. I also have the convolution as a stem graph, however, I tried getting an equation output from this and have not had any luck.
Below is my code that works as I want minus turning w into a function.
clear all;
close all;
subplot(2,2,1);
n = -9:9;
A = 3.*n.*heaviside(-n);
stem(n,A)
title('Graph of x(n)')
xlabel('n')
ylabel('x(n)')
subplot(2,2,2);
k = 0:9;
for m = 1:numel(k);
H(m) = 1;
end
stem(k,H);
title('Graph of h(n)')
xlabel('n')
ylabel('h(n)')
subplot(2,2,3);
p = 1:28;
w = conv(A,H);
stem(p,w)
title('Graph of y(n): Convolution of h(n) and x(n)')
xlabel('n')
ylabel('y(n)') % code

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!