Anda di halaman 1dari 12

Discrete-Time Systems

4.1 Program Outcomes (POs) Addressed by the Activity


a. Ability to apply knowledge of mathematics and science to solve engineering problems
b. Ability to identify, formulate, and solve engineering problems
c. Ability to use techniques, skills, and modern engineering tools necessary for engineering
practice

4.2 Activity’s Intended Learning Outcomes


a. Employ elementary discrete-time systems in signal manipulation
b. Write MATLAB program that synthesizes the output of a discrete-time system

4.3 Background
Systems are physical devices that perform an operation on a signal (input) in order to produce another
signal (output). A discrete-time system is a system where both the input signal x(n) and the output signal
y(n) are discrete-time signals, as illustrated in Fig. 4.1 below.

input signal Discrete-Time output signal

x(n) System y(n)

Fig. 4.1. Representation of a discrete-time system.

Examples of elementary discrete-time systems that will be covered in this chapter are listed in Table 4.1
below. We will see later how these basic operations can be combined to represent a more complex
system that we often encounter in practice.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 45
Table 4.1. Examples of Discrete-Time Systems

Discrete-time Systems Examples and Functional Representation

Folding (or time-reversal) y(n) = x(−n)


Delay y(n) = x(n−1), where delay = 1
Advance y(n) = x(n+2), where advance = 1
Scaling y(n) = 5x(n), where scaling factor = 5
Decimation (or Down-sampling) y(n) = x(2n), where decimation factor = 2
Nonlinear Device y(n) = sin2[x(n)]

4.4 Folding, Shifting and Scaling


A folding operation, also called time-reversal, may be useful to some applications such as convolution,
imaging and backward masking. Delay and advance operations, generally classified as shifting functions,
may be used for applications such as digital filtering and special effects in audio signals. A simple variable
amplitude scaling system may work as a volume controller for digital audio systems, thereby eliminating
the need for a gain control circuit. Combining shifting and scaling operations may allow us to easily
create an artificial echo generator.

Example 4.1
To quickly perform a folding operation in MATLAB, we may use either the colon operator or the built-in
command ‘fliplr’. This is illustrated by a very simple script ‘script_4_1.m’ shown below in Fig. 4.2.
Running ‘script_4_1.m’ would the produce the output plots shown in Fig. 4.3 below.

Fig. 4.2. The script ‘script_4_1.m’ for Example 4.1.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 46
Fig. 4.3. Output plots produced by ‘script_4_1.m’.

Note from Fig. 4.2 and Fig. 4.3 that our signal ‘x’ is a unit ramp sequence. It may be seen from Fig. 4.3
that a linearly increasing function has been turned into a linearly decreasing function by the folding
operation.

Exercise 4.1
Modify ‘script_4_1.m’ such that it employs the “flip left-to-right” MATLAB built-in function ‘fliplr’. Save
your work as ‘exer_4_1.m’ and write your commands on the space provided below.

Example 4.2
Let us now apply shifting operations to the unit ramp sequence. Suppose we want to apply a delay equal
to 10 time units, and apply an advance equal to 10 time units to our unit ramp sequence, and store the
results to the output variables ‘y1’ and ‘y2’, respectively. The script ‘script_4_2.m’, as shown in Fig. 4.4
below, can accomplish the required task.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 47
Fig. 4.4. The script ‘script_4_2.m’ for Example 4.2.

Note that the delay and advance operations implemented in ‘script_4_2.m’ padded zeros at the start and
at the end, respectively, of the output sequence on the assumption that the system is causal. The input
signal ‘x’, and the output signals ‘y1’ and ‘y2’ are plotted on Fig. 4.5 below.

Fig. 4.5. Output plots produced by ‘script_4_2.m’.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 48
Example 4.3
Now suppose we want to implement scaling up (amplification) and scaling down (attenuation)
operations on the unit ramp sequence. Let us apply scaling factors 2 and 0.5, and respectively store the
results to the output variables ‘y1’ and ‘y2’. Fig. 4.6 below shows the script ‘script_4_3.m’ that would
accomplish the desired operations.

Fig. 4.6. The script ‘script_4_3.m’ for Example 4.3.

Note from ‘script_4_3.m’ that the scaling operation is implemented simply by multiplying the input
signal or vector by the desired scaling factor, a constant. The graphs for the input signal ‘x’, and the
output signals ‘y1’ and ‘y2’ are shown below in Fig. 4.7.

Fig. 4.7. Output plots produced by ‘script_4_3.m’.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 49
Exercise 4.2
In this exercise, we will synthesize the output of an artificial echo generator with two reflection terms.
Write an M-file script that generates the input signal x(n), shown in Fig 4.8 below, and then computes
the output signal y(n) of the discrete-time system specified by the following equation:

1 1
y(n)  x(n)  2 x(n 15)  4 x(n  30)

Make a subplot of the signals x(n) and y(n) for comparison. Save your script as ‘exer_4_2.m’. Make a list
of commands you employed in your script in the space provided below.

Fig. 4.8. Input signal x(n) for Exercise 4.2.

QUESTION 4.1:
Is the output signal y(n) generally periodic? If yes, state the period of y(n). Do the values of the delays of
the reflection terms in the form x(n-k), where k=delay, affect the period of y(n)? Explain why or why
not.

The output signal of the system is periodic with a period of 40 units, this is due to the first
cycle is not uniform compared to the second signal cycle. This did not affect the period due
to the output signal is consist of the original signal without any alterations being done.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 50
4.5 Decimation and Nonlinear Systems
Decimation, also called down-sampling, is a fundamental operation in signal compression, a very
important subfield in DSP in that it allows us to optimize the use of available computer memory and
communications data rate. With today’s technology, it is highly probable that the music files, images and
videos you are using and enjoying each day are compressed signals. This section will demonstrate how
we can easily perform decimation in MATLAB. Another example presented in this section involves a
nonlinear system operation.

Example 4.4
Suppose we want to apply decimation by a factor of 3 to the unit ramp sequence presented in the
previous examples in this chapter. This would mean simply taking every third sample in the input
sequence. The MATLAB script for accomplishing the desired operation, ‘script_4_4.m’, is given below in
Fig. 4.9. For comparison, the subplots for the input signal versus the output decimated signal are shown
next in Fig. 4.10. Note the different time scales for the two signals presented in Fig. 4.10.

Fig. 4.9. The script ‘script_4_4.m’ for Example 4.4.

Fig. 4.10. Output plots produced by ‘script_4_4.m’.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 51
Example 4.5
Let us now look into a couple of examples of nonlinear systems or operations. For simplicity, let us again
use the unit ramp sequence presented in the previous examples in this chapter as our input signal x(n).
We want to implement the nonlinear systems represented by the following equations:

 System 1: y1 (n)  x(n)  x(n 10)


y (n)  sin2 x(n)
 System 2: 2

The MATLAB program ‘script_4_5.m’, given in Fig. 4.11 below, would implement the above systems, and
would compute and plot the input and the output signals.

Fig. 4.11. MATLAB program ‘script_4_5.m’ for Example 4.5.

Observe how dot operators are used with the multiplication and with the exponentiation operations in
lines 4 and 5, respectively, of ‘script_4_5.m’. The dot operators would indicate element-wise or element-
by-element operations instead of matrix operations.

The input signal x(n) and the output signals y1(n) and y2(n) are plotted for comparison in Fig. 4.12
below.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 52
Fig. 4.12. Input and output signals produced by ‘script_4_5.m’.

Exercise 4.3
Write an M-file script that would compute and generate the subplots for the input signal x(n) and the
output signals y1(n) and y2(n) as results of implementing the following systems:

y (n)  1 x(2n 1)


 System 1: 1
3
 1 x(n)
 System 2:
y (n)  x(n)  tanh
2  

10 
Let x(n) be the same input signal as given in Example 4.2. Save your work as ‘exer_4_3.m’. Generate a
subplot of signals x(n), y1(n) and y2(n). List down your M-file commands in the space provided below.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 53
QUESTION 4.2:
What is your interpretation of the index expression (2n+1) for System 1? How does this index expression
relate to the length of y1(n)?

The index expression (2n+1) for system 1 shows that the original signal is being down-
sampled by a factor of 2 and the signal is advanced by 1. The decimation factor 2 divides
the intervals of the period by 2 making the signal 30 to 15 units.

QUESTION 4.3:
Is the output signal y2(n) also periodic? If yes, state the period of y(n). Are the periods of x(n) and
y2(n) equal? Explain why or why not.

The output of the second output signal is periodic with 30 units making the signal equal to
the input signal. The tanh() with 1/10 factor makes the multiplier to the input signal close
to 1. The graph has almost the same results to the ramp signal.

*** Machine Problem


The Lab Instructor provides the machine problem for this chapter.

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 54
MATLAB Code/Notes:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 55
Results and Conclusion:
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

DSP Lab Manual – Ronald M. Pascual & FEU Institute of Technology Page 56

Anda mungkin juga menyukai