Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Lab Exercise

HIGHER COLLEGES OF TECHNOLOGY


1 FACULTY OF ENGINEERING TECHNOLOGY & SCIENCE

Discrete-Time Signals
1. GENERATION OF SEQUENCES
1.1 Unit sample and unit step sequences
1. Insert a copy of program P1_1.m below:

< Insert MATLAB code here >

2. Insert the unit sample sequence s[n] generated by running program P1_1.m
below:

< Insert MATLAB figure(s) here >

3. What is the purpose of each of the following MATLAB commands?


- clf:
- axis:
- title:
- xlabel:
- ylabel:

4. Run program P1_1.m to generate a delayed unit sample sequence sd[n] with a
delay of 11 samples. Insert the sequence generated by running it below:

< Insert MATLAB figure(s) here >

5. Modify program P1_1.m to generate a unit step sequence u[n]. Save the new
program as P1_1a.m. Insert a copy of the modified program along with the
sequence generated by running it below:

< Insert MATLAB code here >

< Insert MATLAB figure(s) here >


6. Run program P1_1a.m to generate a unit step sequence ud[n] with an advance of
7 samples. Insert the sequence generated by running it below:

< Insert MATLAB code here >

< Insert MATLAB figure(s) here >

1.2 Exponential signals


7. Insert a copy of program P1_2.m below:

< Insert MATLAB code here >

8. Insert the real-valued exponential sequence generated by running program


P1_2.m below:

< Insert MATLAB figure(s) here >

9. What is the parameter that controls the rate of growth or decay of this sequence?

10. What is the parameter that controls the amplitude of this sequence?

11. Calculate the energy of this sequence?

12. What is the difference between the arithmetic operators ^ and .^ ?

13. Insert below the sequence generated by running program P1_2.m with the
parameter “a” changed to 0.9 and the parameter “K” changed to 20:

< Insert MATLAB figure(s) here >

14. What is the length of this sequence?

15. What is the MATLAB command line that controls this length?
16. Calculate the energy of this sequence?

17. Insert a copy of program P1_3.m below:

< Insert MATLAB code here >

18. Insert the complex-valued exponential sequence generated by running program


P1_3.m below:

< Insert MATLAB figure(s) here >

19. What is the parameter that controls the rate of growth or decay of this sequence?

20. What is the result of changing the parameter c to (1/12)+(pi/6)*1i ?

21. What is the purpose of each of the following MATLAB commands?

- real:

- imag:

- subplot:
1.3 Sinusoidal sequences
22. Insert a copy of program P1_4.m below:

< Insert MATLAB code here >

23. Insert the sinusoidal sequence generated by running program P1_4.m below:

< Insert MATLAB figure(s) here >

24. What is the frequency of this sequence?

25. What is the MATLAB command line that controls this frequency?

26. What is the parameter that controls the phase of this sequence?
27. What is the parameter that controls the amplitude of this sequence?

28. What is the period of this sequence?

29. What is the length of this sequence?

30. Calculate the average power of the generated sinusoidal sequence?

31. What is the purpose of the ‘grid’ MATLAB commands?

- grid:

32. Use program P1_4.m to generate a sinusoidal sequence of length 50 samples,


frequency 0.08, amplitude 2.5, and phase shift of 90 degrees. Insert the generated
sequence below:

< Insert MATLAB figure(s) here >

1.4 Random signals


33. Write a MATLAB program to generate a random signal of length 100 samples
with elements uniformly distributed in the interval [–2, 2]. Save the program as
P1_4a.m. Insert a copy of this program along with the sequence generated by
running it below:

< Insert MATLAB code here >

< Insert MATLAB figure(s) here >

34. Write a MATLAB program to generate a Gaussian random signal of length 75


samples with elements normally distributed with zero mean and a variance of 3.
Save the program as P1_4b.m. Insert a copy of the modified program along with
the sequence generated by running it below:

< Insert MATLAB code here >

< Insert MATLAB figure(s) here >


2. SIMPLE OPERATIONS ON SEQUENCES
2.1 Signal Smoothing
35. Insert a copy of program P1_5.m below:

< Insert MATLAB code here >

36. Insert the signal generated by running program P1_5.m below:

< Insert MATLAB figure(s) here >

37. What is the uncorrupted signal?

38. What is the additive noise?

39. Can the statement (x = s + d) be used instead of (x = s + d’) to generate the noise-
corrupted signal? Why?

40. What are the relations between the signals x1, x2, and x3, and the signal x?

41. What is the purpose of the ‘legend’ command?

- legend:

END OF LAB EXERCISE

You might also like