Escolar Documentos
Profissional Documentos
Cultura Documentos
-10
-8
-6
-4
1
0.8
0.6
0.4
0.2
0
-0.2 0
-0.4
-0.6
-0.8
-1
-2
sin (x)
10
x
Example 2 continous signal
x (t))
exp (t))
100
90
80
70
60
50
x (t))
40
30
20
10
-10
-8
-6
-4
-2
10
t
Example 3 continous signal
x (t))
3 cos (2
t))
3
2.4
1.8
1.2
0.6
-10
-8
-6
-4
-2
0
-0.6
-1.2
-1.8
-2.4
-3
Page 1 of 23
10
x (t))
tstart
10
tend 20
n tstart tend
0.95
0.6
n
y (n))
x (n))
sin (
n))
1.8
1.5
1.2
0.9
0.6
0.3
-10.5
-7
-3.5
x (n) y (n)
0
3.5
10.5
14
17.5
21
-0.3
-0.6
-0.9
-1.2
2
1.6
1.2
0.8
0.4
-10
-8
-6
-4
-2
0
-0.4
sin (x))
0
10
cos (2 x)
-0.8
-1.2
-1.6
-2
x
The signals are continous in time but discontinous in amplitude for cos(2x).
Page 2 of 23
tstart
10
tend 20
n tstart tend
0.6
x (n)) sin ( n))
Set plot to type stem trace in Trace Group/Panel
1
0.8
0.6
0.4
0.2
-10.5
-7
-3.5
3.5
10.5
14
17.5
x (n)
21
-0.2
-0.4
-0.6
-0.8
-1
tstart
10
tend 20
n tstart tend
0.95
n
y (n))
1.7
1.55
1.4
1.25
1.1
y (n))
0.95
0.8
0.65
0.5
0.35
-10.5
-7
-3.5
3.5
Page 3 of 23
10.5
14
17.5
21
tstart 10
tend
20
n tstart tend
n
1
2
if n 0
0
f (n))
f (n))
-21
-17.5
-14
0
-10.5
-7
-3.5
3.5
10.5
Values for n= 10 and -20 shown below. n>=0 range is very close to zero
which is set to zero in the if else statement ie last line.
f_10
1
2
10
f_minus_20
= 0.000977
1
2
20
= 1.049 10
Page 4 of 23
tstart 10
tend
20
n tstart tend
n
1
2
if n 0
0
f (n))
f (n))
-21
-17.5
-14
0
-10.5
-7
-3.5
3.5
10.5
Values for n= 10 and -20 shown below. n>=0 range is very close to zero
which is set to zero in the if else statement ie last line.
f_10
1
2
10
f_minus_20
= 0.000977
1
2
20
= 1.049 10
Page 5 of 23
factorial (n))
if (n
0 , 1 , n factorial (n 1)))
factorial (1)) = 1
factorial (5)) = 120
Now we use recursion to define the period of the sawtooth plot
F (x)) 2 x
period 2
G (x))
x
0 , 0.1 10
4
3.6
3.2
2.8
2.4
2
G (x))
1.6
1.2
0.8
0.4
0
0
Page 6 of 23
10
u (t))
(t))
10 , 9.99 10
x (t))
t u (t 1))
t u (t
4))
2.007
2
x (t))
1.6
1.2
0.8
0.4
-10
-8
-6
-4
-2
10
t
Heaviside funtion equal 1 for positive values.
at t = 2
x(t) = t u(t-1)-t u((t-4)
so look at t = 1 to t=4, like this -->u(t-4)-->t-4=0 t=4
2(u(2-1))-2(u(2-4))
2(u(1))-2(u(-2))
2u(1) -2u(-2)
2(1) - 2(0)
2.
Plot above shows at t = 2, x(2) = 2.
Next
y (t , u))
Page 7 of 23
4
3.6
3.2
2.8
2.4
2
y (t , x )
1.6
1.2
0.8
0.4
-10
-8
-6
-4
-2
10
Next
the period
y (t , u))
x (t))
5)) , (0.8))
u (t 1)) , (0))
1
0.9
0.8
0.7
0.6
0.5
x (t)
0.4
0.3
0.2
0.1
-10
-8
-6
-4
-2
Page 8 of 23
10
-10
-8
-6
-4
-2
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
y (t , x)
10
t
t
15 , 14.99 77
x1 (t))
t u (t 1))
t u (t 4))
x2 (t))
y (t , u))
defining the
periodic signal
4
3.6
3.2
2.8
2.4
2
x2 (t)
1.6
1.2
0.8
0.4
-15
-12.5
-10
-7.5
-5
-2.5
2.5
Page 9 of 23
7.5
10
-15
-10
4
3.6
3.2
2.8
2.4
2
1.6
1.2
0.8
0.4
0
-5
y (t , x2))
10
15
20
25
30
t
Next
y (t , u))
defining the
function
4
3.6
3.2
2.8
2.4
2
x2 (t)
1.6
1.2
0.8
0.4
-15
-12.5
-10
-7.5
-5
-2.5
2.5
7.5
10
t
u (t))
t
(t))
15 , 14.99 15
x (t))
x2 (t))
t u (t 1))
t u (t
x (t)) + x ( t + 8))
4))
Page 10 of 23
-15
-12.5
-10
-7.5
-5
-2.5
4
3.6
3.2
2.8
2.4
2
1.6
1.2
0.8
0.4
0
x2 (t))
2.5
7.5
10
4
3.6
3.2
2.8
2.4
2
y (t , x2))
1.6
1.2
0.8
0.4
-15
-12
-9
-6
-3
12
15
Re-initialise Variables:
Here we are going to set the variables to zero so that there are no errors.
y (x1 , t))
0
0
x (t))
y (x2 , t))
y (t))
0
y (x , t))
0
n
x1 (t))
x2 (t))
Page 11 of 23
wn whiten (1000))
n 0 last (wn))
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-0.1
100
200
300
400
500
600
700
800
900
wn
-0.2
-0.3
-0.4
-0.5
-0.6
-0.7
1
= 0.289
12
Note the mean and std dev of the white noise vector do not deviate much from
the theorectical values.
Example 2.12 Gaussian Noise
The function gaussion (n) simulates n independent sources, each following a gaussian
probability distribution of mean 0, and standard deviation 1. This type of noise is present
any time we sum a large number of independent voltages.
gn gaussn (1000))
i 0 last (gn))
Page 12 of 23
3.75
3
2.25
1.5
0.75
0
100
200
300
400
500
600
700
800
900
-0.75
-1.5
-2.25
-3
-3.75
slots
( 3.5)) + j
7
nslots
slotsnslots
3.5
pd
Page 13 of 23
gn
150
135
120
105
90
75
pd
60
45
30
15
0
10
12
14
16
18
20
j
mean (pd)) = 52.474
stdev (pd)) = 49.388
Example 2.14 1/f noise:
Special type of white noise, also called pink noise. It is used to model a number of real
world processes, such as audio signal processing. Pink noise also describes the
instability of many common oscillators.
1.6
1.2
0.8
0.4
0
-0.4
100
200
300
400
500
600
700
800
900
ofn
-0.8
-1.2
-1.6
-2
-2.4
Page 14 of 23
tstart
10
tend 20
n tstart tend
u (n))
if n 0
u 1
else if n 0
u 0
2
1.6
1.2
0.8
0.4
-10.5
-7
-3.5
0
0
3.5
10.5
14
17.5
-0.4
-0.8
-1.2
-1.6
-2
Page 15 of 23
21
u (t)
x (n))
(n))
1
0.9
0.8
0.7
0.6
0.5
x (t)
0.4
0.3
0.2
0.1
0
-10.5
-7
-3.5
3.5
10.5
14
17.5
21
tstart
10
tend 20
n tstart tend
(t))
if t
0
1
else
0
-15 -12 -9
-6
-3
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
(t)
12
15
Page 16 of 23
tstart
10
tend 20
n tstart tend
u (n))
if n 0
u 1
else if n 0
u 0
-10.5
-7
2
1.6
1.2
0.8
0.4
0
-3.5 -0.4 0
-0.8
-1.2
-1.6
-2
3.5
10.5
14
17.5
u (t 2))
21
-10.5
-7
2
1.6
1.2
0.8
0.4
0
-3.5 -0.4 0
-0.8
-1.2
-1.6
-2
3.5
10.5
14
17.5
Page 17 of 23
21
u (t + 2))
2
1.6
1.2
0.8
0.4
-10.5
-7
-3.5
0
-0.4
3.5
10.5
14
17.5
0.6
1.2
2 u (t))
21
-0.8
-1.2
-1.6
-2
t
Scaling for a = 3, t0 = 1, and t = -t:
3
2.5
2
1.5
1
0.5
-3
-2.4
-1.8
-1.2
-0.6
0
-0.5
1.8
2.4
-1
-1.5
-2
t
Scaling for a = 3, t0 = - 2, and t = -t
2
1.5
1
0.5
-10.5
-7
-3.5
0
-0.5
3.5
10.5
14
17.5
21
3 u (t + 2)
-1
-1.5
-2
-2.5
-3
Page 18 of 23
3 u( t
1)
(t 2)
3
12
15
t
Scaling for a = 0.5, t0 = 1:
-15 -12 -9
-6
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-3 0
0.5
3
12
(t 1)
15
(t 2)
0
-15-12 -9 -6 -3 0
-0.3
-0.6
-0.9
-1.2
-1.5
-1.8
-2.1
-2.4
-2.7
-3
Page 19 of 23
9 12 15
( t 2)
-5
-4
-3
-2
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-1
x (t))
t
Signal shifted by negative sign, -t.
1
0.9
0.8
0.7
0.6
0.5
x ( t))
0.4
0.3
0.2
0.1
-5
-4
-3
-2
0
-1
Page 20 of 23
x (t)) e u (t))
this is the signal
t
5 , 4.99 5
(t))
u (t))
defining the unit step function
t
x (t)) e u (t))
xe (t))
xo (t))
1
2
1
2
(x (t)) + x ( t)))
(x (t))
x ( t)))
0.5
0.5
0.45
0.4
0.4
0.3
0.35
0.2
0.3
0.1
0.25
0.2
0
-5 -4 -3 -2 -1 0
-0.1
xe (t))
0.15
-0.2
0.1
-0.3
0.05
-0.4
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
xo (t))
-0.5
Plot of an even signal is symmetric about t =0, and plot of an odd signal is
asymmetric.
An odd function will intergrate to zero over an integral t = -T to t = T.
Whereas an even signal will adhere to the following relationship:
Page 21 of 23
xeo (t))
xe (t)) + xo (t))
1
0.9
0.8
0.7
0.6
0.5
xeo (t))
0.4
0.3
0.2
0.1
-5
-4
-3
-2
-1
From the previous even and odd signals, their sum here shows a value
in the positive quadrant, elsewhere its zero.
0.25
0.2
0.15
0.1
0.05
-5
-4
-3
-2
-1
-0.05
-0.1
-0.15
-0.2
-0.25
x1 (t))
x2 (t))
t u (t)) t u (t 1))
u (t)) u (t 1))
signal x1(t)
signal x2(t)
Page 22 of 23
xe (t)) xo (t))
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3-2-1 0 1 2 3 4 5
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0
x1 (t))
x2 (t)
3 4
1
0.9
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5-4 -3-2-1 0 1 2 3 4 5
0.8
0.7
0.6
0.5
x11 (t)
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0
x22 (t)
x3 (t))
x1 (t + 1)) + x1 (1 t))
x4 (t))
x2 (t)) + x2 (t
0.5))
1
0.9
0.8
0.7
0.6
0.5
x3 (t)
0.4
0.3
0.2
0.1
-5 -4 -3 -2 -1
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
-5 -4 -3 -2 -1 0
Page 23 of 23
x4 (t)
3 4