Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Practical 1: Signals and Spectra with MATLAB

MATLAB is a very convenient programming language for signal processing. In this prac- tical you will learn how to use MATLAB to generate and represent signals in time and frequency domain, and how to plot them. For more information on MATLAB commands or functions, you may use the MATLAB documentation or the MATLAB commands help and lookfor - or one of the many MATLAB tutorials on the internet.

Do the following exercises with MATLAB. For every exercise, write the solution in form

 of an 1.

2.

3.

m-file. Exercises 16 are preparing you for Exercises 7 and 8. Complex numbers

(a) For the complex number x = 1 + j, compute the real part, the imaginary part, the absolute value and the angle.

(b) For the complex numbers {1, j, 1, j}, compute the real part, the imaginary part, the absolute value and the angle, using vector operations.

Function plots

(a) Plot the function y = x2 for x [0, +2].

(b) Plot the function y = x 21 for x [0, +2] in green in the same figure.

(c) To above plot, add labels for the axes and grid lines. Add further title and a legend.

Complex exponential function

(a) Plot the function y = sin(2πt) for t [0, 2.5].

(b) Consider the function x = ej2πt for t [0, 2.5]. For this function, plot the real part, the imaginary part, the absolute value and the angle in four different subplots in the same figure.

(c) Make a 3D plot of the function x = ej2πt for t [0,2.5]. Add labels for the three axes. (And rotate the figure with the mouse.)

Plots and sampling period

Consider the signal x(t) = sin(2πf0t) for t [0, 2T0], T0 = 1/f0 and f0 = 103 Hz.

(a) Use the sampling period of Ts = T0/10 (i.e. 10 sample points per T0 seconds) and plot the signal.

(b) Use the sampling period Ts = T0/20 and plot the signal in the same figure (in a different colour).

(c) Use the sampling period Ts = T0/4 and plot the signal in the same figure (in a different colour).

(d) Interpret the results.

4.

 Practical 1: Signals and Spectra with MATLAB Page 1

EEET 3028

Introduction to Communication Systems

5. The rectangular pulse Consider the rectangular pulse

rect(t) =

(a) Write a MATLAB function for rect(t).

(b) Plot rect(t) for t [2, 2].

University of South Australia School of Engineering

 6. The sinc-function Consider the function

sinc(t) = sinπt, πt

���1 for|t|12, 0 otherwise.

(c) Define the x-axis to go from 3 to +3, and the y-axis to go from 2 to +2. Label the axes.

 and use the corresponding MATLAB function in the following.

(a) Plot the signal s(t) = sinc(f0t) for t [10T0,10T0], f0 = 1/T0, T0 = 2. Use

the sampling period Ts = T0/10.

(b) Turn on the grid lines in the figure.

(c) Interpret the zeros of s(t).

7. Manipulations of signals

(a) Plot the signal x1(t) = 2 · sin(2πf1t) with f1 = 10 Hz. (b) Plot the signal x2(t) = 2 + x1(t).

(c) Plot the signal x3(t) = sin(2πf3t) with f3 = 10f1. (d) Plot the signal x4(t) = x1(t) · x3(t).

8. Spectra of signals

Use the MATLAB function ft.m (provided on the course webpage) to compute the Fourier transform. (This function is only a user-friendly interface to fft.m.)

Write an m-file to perform steps (a) to (c). This will make it easier for you to do (e), (f), and (g).

(a) Define a sinusoidal signal x(t).

(b) Compute the Fourier transform X(f) of this signal.

(c) Use a figure with two subplots, and plot the signal in one subplot and its magnitude spectrum in the other subplot.

(d) Interpret your results.

(e) Change the length of the signal x(t) and repeat (b), (c), (d).

(f) Change the sampling period of the signal x(t) and repeat (b), (c), (d).

(g) Define a rectangular signal y(t) and repeat (b), (c), (d).