I can understand from unit step function in the end of the equation that $n=[3 \quad4]$, but I cannot understand how delta function affects the signal in order to solve it and put it on matlab.
$\begingroup$
$\endgroup$
8
-
1$\begingroup$ what do you mean with "solve it"? There's nothing to be solved here; it's an equation that gives you $x_1$. $\endgroup$– Marcus MüllerCommented Jan 14, 2018 at 16:41
-
$\begingroup$ I cannot understand how this equation can be written in matlab, that's what I mean by "solve it". $\endgroup$– agelosnmCommented Jan 14, 2018 at 16:44
-
$\begingroup$ You cannot directly write it in Matlab, because of the infinite sums. However, you can plot the resulting signal in Matlab, guessing the values of $x_1$ for all $n$s $\endgroup$– Laurent DuvalCommented Jan 14, 2018 at 16:49
-
1$\begingroup$ @LaurentDuval I know I cannot write it directly, I just couldn't think how I could do it. Βasically, how to make it to a form that can be written in matlab. Your answer made it very clear to me though. :) $\endgroup$– agelosnmCommented Jan 14, 2018 at 16:52
-
1$\begingroup$ Good, please append you final solution when you get it $\endgroup$– Laurent DuvalCommented Jan 14, 2018 at 16:58
|
Show 3 more comments
1 Answer
$\begingroup$
$\endgroup$
2
What is misleading is that you ought to find the values of $x_1[n]$ for all $n$.
For the first term, assuming convention $\cdot^0=1$, you get $\delta[n]+\delta[n-2]$. For the second one, all terms except for $k=2$ cancel each other, so you only gain another $\delta[n-2]$. Then, as you guessed, the last term (without the initial minus sign), is 1 for $n=3,4$, and zero elsewhere.
-
$\begingroup$ I think the matlab code for this is the following: clear,clc n=-10:10; x=zeros(1,length(n)); x(11:12)=1; x(13)=2; x(14:15)=1; stem(n,x) $\endgroup$– agelosnmCommented Jan 14, 2018 at 17:26
-
$\begingroup$ I'd suggest you happen it with a plot to your question, at the end. $\endgroup$ Commented Jan 14, 2018 at 17:28