0% found this document useful (0 votes)
106 views

Exercise No. 1: MATLAB Discrete-Time Signal Objectives:: Unit Sample Sequence

This document provides instructions for completing various exercises in MATLAB to analyze and manipulate discrete-time signals. It includes creating MATLAB functions to represent unit sample sequences, unit step sequences, time shifting signals, and folding signals. The student is prompted to write MATLAB commands to generate and manipulate these signals, and write the results.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views

Exercise No. 1: MATLAB Discrete-Time Signal Objectives:: Unit Sample Sequence

This document provides instructions for completing various exercises in MATLAB to analyze and manipulate discrete-time signals. It includes creating MATLAB functions to represent unit sample sequences, unit step sequences, time shifting signals, and folding signals. The student is prompted to write MATLAB commands to generate and manipulate these signals, and write the results.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Bulacan State University College of Engineering Ece 441L: Signal, Spectra and Signal Processing Lab Name: _________________________________

Date: ___________________ ECE 4___ Comp No. ___

Exercise No. 1: MATLAB Discrete-Time Signal Objectives: In this Exercise you will learn to: 1. Create MATLAB functions of signals 2. Create MATLAB functions of signal manipulations 3. Apply the created MATLAB functions to perform DiscreteTime Signal Processing. Creating MATLAB Functions of Signals 1. Create a folder at document file, name it ECE4sectionSURNAMEfirstname. 2. Open MATLAB and click the New button to go the Editor/Debugger Window. Unit Sample Sequence 3. Copy the commands in Figure 1 from your lecture. 4. Save the function to your created folder in the document file and name the function as sampseq. 5. Close the Editor Window. 6. From the command window, the current directory must be the folder name you created. 7. Now we are ready to test the function you created. The equation of unit sample sequence will be represented in MATLAB:
1 n = 0 ( n) = 0 n 0

The time n will be from 5 to 5 since MATLAB can only perform finite duration. 8. Copy the following command to represent the Unit Sample sequence in MATLAB: n0=0; n1=-5; n2=5; x = sampseq(n0, n1, n2) 9. Write the answer in the space provided.

10. Next, lets try this equation: (n 2) . The Unit sample sequence is delayed by 2

samples in time. To do this, copy the following command: n0=2; n1=-5; n2=5; x = sampseq(n0, n1, n2) 11. Write the answer in the space provided.

12. Now Create a command that will perform the equation: (n + 3) for time n from 7 to 3.

Write below the command and the answer.

Unit Step Sequence 13. Click New button, then copy the comm0ands in Figure 2. Save it as ustep. 14. To perform the Unit Step sequence equation for time n from 5 to 5:
1 n 0 u ( n) = 0 n < 0

Copy the command below. u1 = ustep(0, -5, 5);

15. Write the answer in the space provided

16. If were going to delay the unit step sequence by 3 samples in time, the equation will be
u (n 3)

for time n from 3 to 7, the command will be as follows:

u2 = ustep(3, -3, 7) 17. Write below the answer for this command.

18. Now Create a command that will perform the equation: u (n + 3) for time n from 7 to 7.

Write below the command and the answer.

Time Shifting. 19. Click New button, then copy the commands in Figure 3. Save it as tshift. 20. Using the given signal:
x( n) ={ 1, 2, 3, 4, 4, 4, 4, 4}

x(n) will be time delayed by 3

sample in time. To do this, copy the following command: n = [-3:4]; x = [1, 2, 3, 4, 4, 4, 4, 4];

[y, ny]=tshift(x,n,3); 21. Write below the answer for this command.

22. If were going to advance the signal x by 2 samples in time, the equation will be
x (n + 2) , the command will be as follows:

[y2,ny2]=tshift(x,n,-2); 23. Write below the answer for this command.

Folding or Reflection. 24. Click New button, then copy the commands in Figure 4. Save it as fold. 25. Using the signal in #20, x(n) will be folded. To do this, copy the following command: [y3, ny3]=fold(x,n); 26. Write the answer in the space provided.

You might also like