By
Davood Shaghaghi
davood.shaghaghi@gmail.com
Step :
heaviside(t)
0.8
0.6
0.4
0.2
-1
-0.5
0.5
1
t
1.5
2.5
ramp :
t heaviside(t)
0
0
4
t
Sinusoidal signals:
1.5
1.5
0.5
0.5
-0.5
-0.5
-1
-1
-1.5
-1.5
-2
-2
-6
-4
-2
0
t
-6
-4
-2
0
t
heaviside(t + 1) - heaviside(t - 1)
0.8
0.6
0.4
0.2
-2
-1.5
-1
-0.5
0
t
0.5
1.5
Time shifting :
Right shift :
heaviside(t) - heaviside(t - 2)
0.8
0.6
0.4
0.2
-2
-1.5
-1
-0.5
0.5
t
1.5
2.5
Left shift :
heaviside(t + 2) - heaviside(t)
0.8
0.6
0.4
0.2
-3
-2.5
-2
-1.5
-1
-0.5
t
0.5
1.5
1.5
0.5
-1
-0.5
0.5
1.5
t
2.5
x=u(t)-ut-3)+u(t-1)-u(t-2);
3.5
xe=1/2(x(t)+x(-t))
1
0.9
0.8
0.5
0.7
0.6
0.5
0.4
-0.5
0.3
0.2
-1
0.1
0
-3
-2
-1
0
t
-3
-2
-1
0
t
0.5
1.5
t
2.5
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3
-2
-1
X1[n]
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
20
40
60
80
100
120
X2[n]
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
20
40
60
80
100
120
Exercise :
Waveform Generation :
(aperiodic) square wave :
t
t
rect ( ) ( ) u(t T ) u(t T )
T
T
1
-T
In Matlab :
The rectpuls function generates a sampled aperiodic, unity-height
rectangular pulse centered about t = 0 and with a default width of 1.
0.8
0.6
0.4
0.2
0
-4
-3
-2
-1
t
t
rect ( ) ( ) u(t 2) u(t 2)
4
4
t
t
( ) 1
T T
0
; T t 0
; 0t T
; |t|T
-T
In Matlab :
The tripuls function generates a sampled aperiodic, unity-height
triangular pulse centered about t = 0 and with a default width of 1.
0.8
0.6
0.4
0.2
0
-4
-3
-2
-1
( t )
3
Amplitude
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-5
-4
-3
-2
-1
0
1
Time (sec)
Amplitude
1
0.5
0
-0.5
-1
0
0.02
0.04
0.06
0.02
0.04
0.06
0.08
0.1
0.12 0.14
Time (sec)
Sawtooth Periodic Wave
0.16
0.18
0.2
0.16
0.18
0.2
Amplitude
1
0.5
0
-0.5
-1
0.08
0.1
0.12
Time (sec)
0.14
Example:
discrete convolution
f1[n]
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-10
-8
-6
-4
-2
10
g1
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-10
-8
-6
-4
-2
10
f1
1
0.5
0
-10
-8
-6
-4
-2
10
10
g1
1
0.5
0
-10
-8
-6
-4
-2
h[n]
4
3.5
2.5
1.5
0.5
0
-20
-15
-10
-5
10
15
20
>> freqz
[h,w] = freqz(hd) returns the frequency response vector h and the corresponding
>> impz
[h,t] = impz(hd) computes the instantaneous impulse response of the discrete
-time filter hd choosing the number of samples for you, and returns the response
in column vector h and a vector of times or sample intervals in t where
(t = [0 1 2...]'). impz returns a matrix h if hd is a vector. Each column of the matrix
corresponds to one filter in the vector. When hd is a vector of discrete-time filters,
impz returns the matrix h. Each column of h corresponds to one filter in the vector
hd.
impz(hd) uses FVTool to plot the impulse response of the discrete-time filter hd.
If hd is a vector of filters, impz plots the response and for each filter in the vector.
>> stepz
[h,t] = stepz(ha) returns the step response h of the multirate filter ha. The length
of column vector h is the length of the impulse response of ha. Returned vector t
contains the time samples at which stepz evaluated the step response. stepz
returns h as a matrix when ha is a vector of filters.
Each column of the matrix corresponds to one filter in the vector.
stepz(ha) displays the filter step response in the Filter Visualization Tool
(FVTool).
>> fvtool
FVTool(f) displays the signal step response , impulse response and
1.
3
2.
3
Bode Diagram
Magnitude (dB)
-50
-100
-150
-200
-360
Phase (deg)
-360
-360
-360
-360
-360
-1
10
10
10
Frequency (rad/sec)
10
3.
3
24
Impulse Response
x 10
-1
Amplitude
-2
-3
-4
-5
-6
-7
0
10
15
Time (sec)
20
25
30
23
Step Response
x 10
Amplitude
-5
-10
-15
-20
10
15
Time (sec)
20
25
30
5.
1
s+1
Transfer Fcn4
Step
1
Manual Switch
Derivative
s+1
s+1
s+1
s+1
Transfer Fcn
Transfer Fcn1
Transfer Fcn2
Transfer Fcn3
du/dt
Step1
1
s+1
Transfer Fcn5
Scope
weblog:
Shaghaghi.persiangig.com
e-mail:
davood.shaghaghi@gmail.com
Good Luck