You are on page 1of 7

PROCEDURE:

Discrete- Time Signal:


Open MATLAB and plot the following functions for −10 ≤ 𝑡 ≤ 15 sec. Label your axes
appropriately.

Step 1.1: Create a new script.


Step 1.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 1.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
F[n] using the given function for discrete as
2 −𝟓 ≤ 𝒏 ≤ −𝟐
𝟏 −𝟏 ≤ 𝒏 ≤ 𝟐
𝑭[𝒏] = 𝟑 𝟑≤𝒏≤ 𝟓
−𝟏 𝟔 ≤ 𝒏 ≤ 𝟖
{0 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

Step 1.4: Key in stem (t, n, 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square') to graph the function with modified style.
Step 1.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.
Step 1.6: On the last two lines, are the title entered as title('F(n)') and grid on to put grid on the
resulting graph. Click save as the final step.

Step 1.7: Run the program to view the outcome.


Step 2.1: Create a new script.
Step 2.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 2.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
2F[n-5].

Step 2.4: Key in stem (t, 2*(n-5),'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square')to graph the function with modified style.
Step 2.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 2.6: On the last two lines, are the title entered as title('2F(n-5)') and grid on to put grid on
the resulting graph. Click save as the final step.

Step 2.7: Run the program to view the outcome.

Step 3.1: Create a new script.


Step 3.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 3.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
F(-2n-n).

Step 3.4: Key in stem (t, -2*n-n, 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square')to
graph the function with modified style.
Step 3.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 3.6: On the last two lines, are the title entered as title(‘F(-2n-n)’) and grid on to put grid on
the resulting graph. Click save as the final step.

Step 3.7: Run the program to view the outcome.

Step 4.1: Create a new script.


Step 4.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 4.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
-F(2n).

Step 4.4: Key in stem (t, -1.*(2*n), 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square')to graph the function with modified style.
Step 4.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 4.6: On the last two lines, are the title entered as title ('-F(2n)')
and grid on to put grid on the resulting graph. Click save as the final step.
Step 4.7: Run the program to view the outcome.

Step 5.1: Create a new script.


Step 5.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 5.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
1/2F(n/3).

Step 5.4: Key in stem (t, (n/3)/2, 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square') to graph the function with modified style.
Step 5.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 5.6: On the last two lines, are the title entered as title('1/2F(n/3)') and grid on to put grid
on the resulting graph. Click save as the final step.

Step 5.7: Run the program to view the outcome.


Step 6.1: Create a new script.
Step 6.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 6.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
-F(2-n/2).

Step 6.4: Key in stem (t, -1.*(2-n/2), 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square') to graph the function with modified style.
Step 6.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 6.6: On the last two lines, are the title entered as title('-F(2-n/2)') and grid on to put grid
on the resulting graph. Click save as the final step.

Step 6.7: Run the program to view the outcome.


Step 7.1: Create a new script.
Step 7.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 7.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
F(-2-n).

Step 7.4: Key in stem (t, -2-n, 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square')
to graph the function with modified style.
Step 7.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.

Step 7.6: On the last two lines, are the title entered as title('F(-2-n)') and grid on to put grid on
the resulting graph. Click save as the final step.

Step 7.7: Run the program to view the outcome.


Step 8.1: Create a new script.
Step 8.2: Type linspace (-10, 15, 20) to give direct control over the number of points.
Step 8.3: Input n= 2.*(unit_step(t+5)-unit_step(t+2))+1.*(unit_step(t+1)-unit_step(t-
2))+3.*(unit_step(t-3)-unit_step(t-5))-(unit_step(t-6)-unit_step(t-8) to comply with the function
F(n.^2-1).
Step 8.4: Key in stem (t, (n.^2)-1, 'Color', 'red', 'LineStyle','--', 'MarkerEdgeColor', 'blue',
'Marker','square')
to graph the function with modified style.
Step 8.5: Enter ylabel('f(t)') as label for the y-axis and xlabel('t(seconds)') as dub for the x-axis.
Step 8.6: On the last two lines, are the title entered as title('F(n.^2-1)') and grid on to put grid
on the resulting graph. Click save as the final step.

Step 8.7: Run the program to view the outcome.

You might also like