70
Practical MATLAB
® Applications for Engineers
Example 1.11
Given the discrete transfer function
H z
z
z
z
z
z
z
( )
.
.
.
.
.
.
.
ϭ
Ϫ
ϩ
ϩ
ϩ
Ϫ
Ϫ
Ϫ
Ϫ
Ϫ
Ϫ
Ϫ
Ϫ
0 8 0 45
0 35
0 01
1 0 85
0 43
0 58
1
2
3
1
2
3
Create the script fi le disc_tranf_func that returns the following:
a. The discrete impulse and step response plots by creating an impulse and step
sequence as inputs
b. Repeat part a by using the discrete MATLAB functions dimpulse and dstep, and
compare the result obtained with the results of part a
MATLAB Solution
% Script file: disc _ tranf _ func
n = 30;
P = [0.8 -0.45 0.35 0.01];Q = [1 0.85 -0.43 -0.58];
I = [1 zeros(1, n-1)];
% impulse sequence
S = [ones(1, n)] ;
% step sequence
FIGURE 1.59
Plots of f 1 (n), f 2 (n), f 3 (n), and f 4 (n) of Example 1.10.
f1(n) versus n
f2(n) versus n
1
1
0.5
0.5
−0.5
−1
0
0
0
2
4
6
Amplitude [f1(n)]
Amplitude [f2(n)]
Amplitude [f3(n)]
Amplitude [f4(n)]
0
5
10
15
20
25
n
f3(n) versus n
f4(n) versus n
5
0
−5
0
20
30
10
n
n
10
8
6
4
2
0
−1
0
1
2
3
n
CRC_47760_CH001.indd 70
CRC_47760_CH001.indd 70
7/25/2008 4:16:24 PM
7/25/2008 4:16:24 PM
Précédent

- 81/708

Suivant