Sie sind auf Seite 1von 7

Lab 2

Discrete Time Signal


2.1

Introduction

Simulink models can process both discrete-time and continuous-time signals. Models
built with DSP System Toolbox software are often intended to process discrete-time
signals only. A discrete-time signal is a sequence of values that correspond to
particular instants in time. The time instants at which the signal is defined are the
signal's sample times, and the associated signal values are the signal's samples.
Traditionally, a discrete-time signal is considered to be undefined at points in time
between the sample times. For a periodically sampled signal, the equal interval
between any pair of consecutive sample times is the signal's sample period, Ts. The
sample rate, Fs, is the reciprocal of the sample period, or 1/Ts. The sample rate is the
number of samples in the signal per second.
The 7.5-second triangle wave segment below has a sample period of 0.5 second, and
sample times of 0.0, 0.5, 1.0, 1.5, ...,7.5. The sample rate of the sequence is
therefore 1/0.5, or 2 Hz as in figure 2.1.

Figure 2.1: Sampling data for discrete signal.


2.2

Objective

Student undergoes this lab session able to:


i) Understand concept of discrete time signal
ii) Differentiate time and frequency terminology
1

iii) Simulate using MatLab block diagram


2.3 Basic Concept
Simulink allows you to select from several different simulation solver algorithms. You
can access these solver algorithms from a Simulink model:
i) In the Simulink model window, from the Simulation menu, select Model
Configuration Parameters. The Configuration Parameters dialog box opens.
ii) In the Select pane, click Solver.The selections that you make here determine how
discrete-time signals are processed in Simulink. The recommended Solver options
settings for signal processing simulations are:
4

Type: Fixed-step

Solver: Discrete (no continuous states)

Fixed step size (fundamental sample time): auto

Treat each discrete rate as a separate task: Off

Figure 2.2: Configuration MatLab

In the fixed-step, single-tasking mode, discrete-time signals differ from the prototype
described in Time and Frequency Terminology by remaining defined between sample
times. For example, the representation of the discrete-time triangle wave looks like
this.

Figure 2.3: Digital Sampling Signal


The above signal's value at t=3.112 seconds is the same as the signal's value at t=3
seconds. In the fixed-step, single-tasking mode, a signal's sample times are the
instants where the signal is allowed to change values, rather than where the signal is
defined. Between the sample times, the signal takes on the value at the previous
sample time.
As a result, in the fixed-step, single-tasking mode, Simulink permits cross-rate
operations such as the addition of two signals of different rates. This is explained
further in Cross-Rate Operations.

2.4 Methodology
i. At the MATLAB command line, type ex_sum_tut1. The Cross-Rate Sum Example
model opens. This model sums two signals with different sample periods.

ii. Double-click the upper Signal From Workspace block. The Block Parameters:
Signal From Workspace dialog box opens.
iii. Set the Sample time parameter to 1.This creates a fast signal, (Ts=1), with sample
times 1, 2, 3, ...
iv. Double-click the lower Signal From Workspace block
v. Set the Sample time parameter to 2.This creates a slow signal, (Ts=2), with sample
times 1, 3, 5, ...
vi. From the Display menu choose Sample Time > Colors.Checking the Colors option
allows you to see the different sampling rates in action. For more information about
the color coding of the sample times see View Sample Time Information in the
Simulink documentation.
vii. Run the model.

2.5 Result
At the MATLAB command line, type dsp_examples_yout. The following output is
displayed:

The first column of the matrix is the fast signal, (Ts=1). The second column of the
matrix is the slow signal (Ts=2). The third column is the sum of the two signals. As
expected, the slow signal changes once every 2 seconds, half as often as the fast
signal. Nevertheless, the slow signal is defined at every moment because Simulink
holds the previous value of the slower signal during time instances that the block
doesn't run.
In general, for Variable-step and the fixed-step, single-tasking modes, when you
measure the value of a discrete signal between sample times, you are observing the
value of the signal at the previous sample time.

2.6 Task
Using data in result, manually calculate modulation process and sample time for both
signal from workspace and signal from workspace is 2. Discuss and analyze the
result.

2.7 Discussions and Conclusion


Discussion
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Conclusion
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Das könnte Ihnen auch gefallen