PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Time Domain Representation of Continuous and Discrete Signals 43


The script fi le disc_ step is executed and the results are given as follows and in
Figure 1.38.
*****************************************************************
The discrete step sequence u(n) for the first 10 samples is:
^^^^^^^^^^^^^^^^^^^^
n u(n)
^^^^^^^^^^^^^^^^^^^^
0 2.2400
1.0000 3.6200
2.0000 3.6568
3.0000 2.7000
4.0000 3.1534
5.0000 3.5773
6.0000 3.0570
7.0000 3.0289
8.0000 3.3968
9.0000 3.2320
*****************************************************************

R.1.125 The MATLAB function [y, n] = fi lter(b, a, x) defi ned in Chapter 7 of the book titled
Practical MATLAB® Basics for Engineers returns the output sequence y, when the
relation input (x) output (y) is given by the following system difference equation:

ayn kk bxn l
k

N
l
l

N

==

∑∑
0

1

0

2
() ()

R.1.126 A discrete sequence may consist of either a fi nite or infi nite number of samples.
A fi nite length sequence is characterized by a fi nite number of nonzero sam-
ples. An infi nite length sequence extends infi nitely to the right or the left of
the n-axis (discrete time). In either case, the infi nite or fi nite sequences can be
represented by a sum of weighted time-shifted impulse samples.

Discrete step response u(n) versus n
4

3.5

2.5

2

1.5

0.5

0
0 1 2 3 4 5 6 7 8 9

1

3

time index n

Amplitude [u(n)]

FIGURE 1.38
Discrete step response of R.1.124.
Free download pdf