Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI

Hyderabad Campus
Digital Signal Processing

Lab 3
You are instructed to write solutions, plots, observations and explorations in
your observation record and get it signed before leaving the lab

In this lab, you will use a Simulink blockset to generate a simple design and take it
through simulation. You will then change the sampling settings to see its effect on
the output. You will then learn how to create a subsystem.
General Flow for this Lab:
[1]

Step 1:
Introduction to
Simulink

Step2:
Analyzing
sampling
Period Effect

Step 3:
Creating a
Simple Filter
Design

Step 4:
Creating a
Subsystem

(a) Generate a sinusoidal signal using Simulink. Assign 2*pi*(1/150) frequency to the Sine
Wave element .Change the stop time of the simulation to 150 and set the Solver options as
shown in Figure 1. (Simulation Configuration Parameters).

Figure 1. Simulation Parameters Dialog Box


(b) Run the simulation at a slower sampling period (sample period of 5) of the sine wave
source and analyze the sampling period effect. Then change the stop time to 500, run the

simulation, and observe the output. Change the stop time back to 150 and Change the sample
period of the Sine Wave source back from 5 to 0.
(c) Build a simple design to implement the following function by using the appropriate blocks
from the Simulink blockset.

Y (n+1) = X (n+1) + 3 * X (n-1)


Steps:

From the Simulink Library Browser, select the discrete library. Select and add the
Integer Delay block to the design

Double-click the Delay block and change the delay to 2.

From the Simulink Library Browser, select the Math Operations library. Select and
add the Gain block to the design

Double-click the Gain block and change the gain to 3.

From the Simulink Library Browser, select the Math Operations library. Select and
add the Add block to the design.

Run the simulation and observe the output.

(d) Select all the blocks between the source and the sink and create a subsystem. Run the
simulation and verify that the output is still same. (Digram Create Subsystem).

[2] Given discrete transfer function of different systems is

Create a model to display the input and output waveforms when the input is
(i) the unit step function and (ii) discrete sine function if the sample time is period is 0.1 s.

[3] Create a model with Quantization Interval 0.25. The input will be a sine waveform with
amplitude 1 and frequency 0.25 Hz. Use signal generator, quanitizer and bus creator.

[4] Create a model using a ZeroOrder Hold block with sample time 1 and input a random
waveform with amplitude 1 and frequency 1 Hz.

[5] Generate sinusoidal signals of

Sine wave 1: Amplitude: 1, Freq (Hz): 0.25, Phase: 0, Sample Time: 0.05,
Sine Wave 2: Amplitude: 2, Freq (Hz): 0.75, Phase: pi/6, Sample Time: 0.05,
Sine Wave 3: Amplitude: 5, Freq (Hz): 1.5, Phase: pi/3, Sample Time: 0.05,
(All other parameters in their default state)
Add The Random Source block and is configured as follows:
Source type: Gaussian, Method: Ziggurat, Initial seed: [23341], Sample Time: 0.05

Observe the input and output waveforms.

[6]
a) Design a signal generator block which generate a composite signal. This composite
signal is the combination of sinusoidal signals of frequency 50 rad/sec, 100ras/sec,
150rad/sec. 200rad/sec and 250 read/sec. View the power spectrum of the signal.

b) Design a filter unit(may be combination of number of filter units)and give the name as
myfilter1, which gives the filtered out put as only 100ras/sec, 200rad/sec.
c) Design a filter unit(may be combination of number of filter units) and give the name
as myfilter2, which gives the filtered out put as only 50ras/sec, 250rad/sec.

You might also like