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

LABEX1 (hoàn chỉnh)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

LABEX1 (hoàn chỉnh)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 28

Name: Phạm Ngọc Thạch - 22161186

Section:

Laboratory Exercise 1
DISCRETE-TIME SIGNALS: TIME-DOMAIN REPRESENTATION

1.1 GENERATION OF SEQUENCES

Project 1.1 Unit sample and unit step sequences

A copy of Program P1_1 is given below.

< Insert program code here. Copy from m-file(s) and paste. >

Answers:

Q1.1 The unit sample sequence u[n] generated by running Program P1_1 is shown
below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

1
Unit Sample Sequence
1.2

0.8
Amplitude

0.6

0.4

0.2

0
-10 -5 0 5 10 15 20
Time index n

Q1.2 The purpose of clf command is - used to clear the current figure

The purpose of axis command is - specifies the limits for the current axes

The purpose of title command is - adds the specified title to the axes or chart

The purpose of xlabel command is - used to label x-axis

The purpose of ylabel command is - used to label y-axis

Q1.3 The modified Program P1_1 to generate a delayed unit sample sequence ud[n]
with a delay of 11 samples is given below along with the sequence generated by
running this program.

< Insert program code here. Copy from m-file(s) and paste. >

Insert MATLAB figure(s) here. Copy from figure window(s) and paste. >

2
Unit Sample Sequence
1.2

0.8

Amplitude
0.6

0.4

0.2

0
-10 -5 0 5 10 15 20
Time index n

Q1.4 The modified Program P1_1 to generate a unit step sequence s[n] is given below
along with the sequence generated by running this program .

< Insert program code here. Copy from m-file(s) and paste. >

< Insert MATLAB figure(s) here. Copy from figure window(s) and paste. >

3
Unit Sample Sequence
1.2

0.8
Amplitude

0.6

0.4

0.2

0
-10 -5 0 5 10 15 20
Time index n

Q1.5 The modified Program P1_1 to generate a unit step sequence sd[n] with an ad-
vance of 7 samples is given below along with the sequence generated by running
this program.

< Insert program code here. Copy from m-file(s) and paste. >

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

4
Unit Sample Sequence
1.2

0.8
Amplitude

0.6

0.4

0.2

0
-10 -5 0 5 10 15 20
Time index n

Project 1.2 Exponential signals

A copy of Programs P1_2 and P1_3 are given below.

< Insert program code here. Copy from m-file(s) and paste. >

Answers:

5
Q1.6 The complex-valued exponential sequence generated by running Program P1_2 is
shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Real part
2

1
Amplitude

-1

-2
0 5 10 15 20 25 30 35 40
Time index n
Imaginary part
2
Amplitude

-1
0 5 10 15 20 25 30 35 40
Time index n

Q1.7 The parameter controlling the rate of growth or decay of this sequence is -c

The parameter controlling the amplitude of this sequence is -k

Q1.8 The result of changing the parameter c to (1/12)+(pi/6)*i is - Since the


exponential function now has e^1/12  1.087> 1 , it means that the exponential is
increasing, so the signal now has an extended envelope of n (divergence). In

6
contrast to the case c=-1/12+*j/6 with e^(-1/12)  0.92< 1 , we have the envelope
narrowing to n (convergence).

Q1.9 The purpose of the operator real is - to get the real part of a vector

The purpose of the operator imag is - typically called imaginary

Q1.10 The purpose of the command subplot is - is divides the current figure into an
m-by-n grid and creates axes in the position specified by p

Q1.11 The real-valued exponential sequence generated by running Program P1_3 is


shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

120

100

80
Amplitude

60

40

20

0
0 5 10 15 20 25 30 35
Time index n

Q1.12 The parameter controlling the rate of growth or decay of this sequence is -a

The parameter controlling the amplitude of this sequence is - k


Q1.13 The difference between the arithmetic operators ^ and .^ is - raises a square

matrix to a power using matrix multiplication. “.^” raises the elements of a

matrix or vector to a power

7
Q1.14 The sequence generated by running Program P1_3 with the parameter a changed
to 0.9 and the parameter K changed to 20 is shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Exponential Decay Sequence


20

18

16

14

12
Amplitude

10

0
0 5 10 15 20 25 30 35
Time index n

Q1.15 The length of this sequence is - 35

It is controlled by the following MATLAB command line : stem(n,x)

It can be changed to generate sequences with different lengths as follows (give an


example command line and the corresponding length): n=50

Q1.16 The energies of the real-valued exponential sequences x[n]generated in Q1.11


and Q1.14 and computed using the command sum are - Ex = sum(x.*conj(x))

Project 1.3 Sinusoidal sequences

A copy of Program P1_4 is given below.

< Insert program code here. Copy from m-file(s) and paste. >

Answers:

8
Q1.17 The sinusoidal sequence generated by running Program P1_4 is displayed below .

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Sinusoidal Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
Time index n

9
Q1.18 The frequency of this sequence is - 0.1Hz

It is controlled by the following MATLAB command line : f=0.1

A sequence with new frequency __1hz_ can be generated by the following


command line: f=1

The parameter controlling the phase of this sequence is - phase

The parameter controlling the amplitude of this sequence is - constant “A”

The period of this sequence is - T= 1/f = 1/0.1 = 10s

Q1.19 The length of this sequence is - 41

It is controlled by the following MATLAB command line : n = 0:40

A sequence with new length __77_ can be generated by the following command
line: n = 0:76

Q1.20 The average power of the generated sinusoidal sequence is -0

Q1.21 The purpose of axis command is - specifies the limits for the current axes

The purpose of grid command is - on displays the major grid lines for the

current axes or chart

Q1.22 The modified Program P1_4 to generate a sinusoidal sequence of frequency 0.9 is
given below along with the sequence generated by running it .

< Insert program code here. Copy from m-file(s) and paste. >

10
< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Sinusoidal Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
Time index n

11
A comparison of this new sequence with the one generated in Question Q1.17
shows - The two signals have similar shape and both have properties of cosine
functions. As we know, the sine function is a periodic function with period T  2
and is even function cos(  cos - (*). So 0,9.2 -2 =0,1.2, following (*) we
get this conclusion

A sinusoidal sequence of frequency 1.1 generated by modifying Program P1_4 is


shown below.

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Sinusoidal Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
Time index n

A comparison of this new sequence with the one generated in Question Q1.17
shows -

The two signals have similar shape and both have properties of cosine functions one morw time.
As mentioned previously, So 1,1.2 -2=0,1.2, following (*) we get this conclusion
again

Q1.23 The sinusoidal sequence of length 50, frequency 0.08, amplitude 2.5, and phase
shift of 90 degrees generated by modifying Program P1_4 is displayed below .

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

12
Sinusoidal Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
Time index n

The period of this sequence is – T = k2/ = k/f = k/0.08 = 12.5k = 25,50...

Q1.24 By replacing the stem command in Program P1_4 with the plot command, the
plot obtained is as shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

13
Sinusoidal Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40
Time index n

The difference between the new plot and the one generated in Question Q1.17 is -
The main point of difference between the two is that plot displays the continuous
values for the curve by connecting the points with straight line segments, which
approximates the graph of a continuous-time cosine signal. On the other hand,
stem displays the discrete values of the points on the curve.

Q1.25 By replacing the stem command in Program P1_4 with the stairs command the
plot obtained is as shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and paste. >

14
Cosine Sequence

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2

0 5 10 15 20 25 30 35 40 45 50
Time index n

The difference between the new plot and those generated in Questions Q1.17 and
Q1.24 is - a continuous signal

Project 1.4 Random signals

Answers:

Q1.26 The MATLAB program to generate and display a random signal of length 100 with
elements uniformly distributed in the interval [–2, 2] is given below along with the
plot of the random sequence generated by running the program :

15
< Insert program code here. Copy from m-file(s) and paste. >

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

uniform Random Sequence


3

1
Amplitude

-1

-2

-3
0 10 20 30 40 50 60 70 80 90
Time index n

Q1.27 The MATLAB program to generate and display a Gaussian random signal of length
75 with elements normally distributed with zero mean and a variance of 3 is given
below along with the plot of the random sequence generated by running the
program:

16
< Insert program code here. Copy from m-file(s) and paste. >

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Gaussian Random Sequence


6

2
Amplitude

-2

-4

-6
0 10 20 30 40 50 60 70
Time index n

Q1.28 The MATLAB program to generate and display five sample sequences of a random
sinusoidal signal of length 31

{X[n]} = {Acos(on + )}

17
where the amplitude A and the phase  are statistically independent random
variables with uniform probability distribution in the range 0  A  4 for the
amplitude and in the range 0     for the phase is given below. Also shown
are five sample sequences generated by running this program five different times .

< Insert program code here. Copy from m-file(s) and paste. >

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

Sinusoidal Sequence with Random Amplitude and Phase


5

1
Amplitude

-1

-2

-3

-4

-5
0 5 10 15 20 25 30
Time index n

1.2 SIMPLE OPERATIONS ON SEQUENCES

18
Project 1.5 Signal Smoothing

A copy of Program P1_5 is given below.

< Insert program code here. Copy from m-file(s) and paste. >

Answers:

Q1.29 The signals generated by running Program P1_5 are displayed below :

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

19
6 d[n]
s[n]
Amplitude x[n]
4

0
0 5 10 15 20 25 30 35 40 45 50
Time index n

8
y[n]
6 s[n]
Amplitude

0
0 5 10 15 20 25 30 35 40 45 50
Time index n

Q1.30 The uncorrupted signal s[n]is - a decreasing exponential function.

The additive noise d[n]is - a random sequence uniformly distributed between -


0.4 and + 0.4.

Q1.31 The statement x = s + d CAN / CANNOT be used to generate the noise


corrupted signal because - d is a column vector, whereas s is a row vector; it is
necessary to transpose one of these vectors before adding them.

Q1.32 The relations between the signals x1, x2, and x3, and the signal x are - all of
those signals x1, x2, and x3 are another versions of x, with one is at the left and
one is at the right. The signal x1 is a delayed version of x, the signal x2 is equal to
x and x3 is a time advanced version of x

Q1.33 The purpose of the legend command is - used to add legend to graph.

Project 1.6 Generation of Complex Signals

A copy of Program P1_6 is given below.

< Insert program code here. Copy from m-file(s) and paste. >

Answers:

20
Q1.34 The amplitude modulated signals y[n] generated by running Program P1_6 for
various values of the frequencies of the carrier signal xH[n] and the modulating
signal xL[n], and various values of the modulation index m are shown below:

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

1.5

0.5
Amplitude

-0.5

-1

-1.5
0 10 20 30 40 50 60 70 80 90 100
Time index n

Q1.35 The difference between the arithmetic operators * and .* is -

A copy of Program P1_7 is given below.

21
< Insert program code here. Copy from m-file(s) and paste. >

Answers:

Q1.36 The swept-frequency sinusoidal sequence x[n] generated by running Program


P1_7 is displayed below.

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

22
Swept-Frequency Sinusoidal Signal
1.5

0.5
Amplitude

-0.5

-1

-1.5
0 10 20 30 40 50 60 70 80 90 100
Time index n

Q1.37 The minimum and maximum frequencies of this signal are -

As the frequency of a sinusoidal signal is the derivative of its phase with respect
to time, so we have

=an^2 + bn =2an+b = [2. /(2.100)]a.

The minimum frequence is 0 when n  0   0. The maximum frequence is 0.5


when n= 100  2. .100 /2.100  

Q1.38 The Program 1_7 modified to generate a swept sinusoidal signal with a minimum
frequency of 0.1 and a maximum frequency of 0.3 is given below :

< Insert program code here. Copy from m-file(s) and paste. >

ω(min(n=0)) = 2.a.0+b = 0,1.2  b=0.2,

ω(max(n=100)) = 2.a.100+b = 0,3.2  a= 2.10^-3

23
Swept-Frequency Sinusoidal Signal
1.5

0.5
Amplitude

-0.5

-1

-1.5
0 10 20 30 40 50 60 70 80 90 100
Time index n

1.3 WORKSPACE INFORMATION

Q1.39 The information displayed in the command window as a result of the who
command is - a list of variables in current workspace

Q1.40 The information displayed in the command window as a result of the whos
command is - a list of variables in workspace, with sizes and types.

24
1.4 OTHER TYPES OF SIGNALS (Optional)

Project 1.7 Squarewave and Sawtooth Signals

Answer:

Q1.41 MATLAB programs to generate the square-wave and the sawtooth wave sequences
of the type shown in Figures 1.1 and 1.2 are given below along with the sequences
generated by running these programs :

< Insert program codes here. Copy from m-file(s) and paste. >

25
Square Wave Sequence
4

1
Amplitude

-1

-2

-3

-4
0 5 10 15 20 25 30 35 40 45 50
Time index n

26
Sawtooth Wave Sequence
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 10 20 30 40 50 60
Time index n

< Insert MATLAB figure(s) here. Copy from figure window(s) and
paste. >

27
Sawtooth Wave Sequence of Fig. 1.2(b)
2

1.5

0.5
Amplitude

-0.5

-1

-1.5

-2
0 5 10 15 20 25 30 35 40 45 50
Time index n

Date: Signature:

28

You might also like