You are on page 1of 5

ECE 480

Spring/Summer 2016
Computer-Based Assignment # 4
Introduction to the Simulation of Signals and Systems
Prof. S. Awad

Objective:
The objective of this lab is two fold. First, the student will get familiar with Simulink as a tool
to simulate discrete-time and continuous-time signals and systems. Second, some typical systems
will be simulated and the results will be analyzed using Matlab.

(1) Use Simulink to simulate the system shown in Figure 1. The system is composed of a sampled
sine wave of unity amplitude, frequency f1 , and initial phase shift of /4 radians. The signal
will be displayed on the scope. Assume that the sampling frequency (fsamp ) is 40 kHz.

(a) If f1 = 4 kHz, simulate the system with a time equivalent to 5 periods (duration =
5/(4 103 ) seconds) of the sine wave. Display the waveform on the scope and also export
the data of the output to the Matlab workspace to plot the amplitude (discrete-time versus
time in msec). Also, plot the amplitude versus the time index, n.

(b) Change f1 to 124 kHz and investigate the output signal. Compare to part (a) and comment.

(c) What is the apparent frequency of the output if f1 = 34 kHz? Compare to part (a) and
comment.

(d) For the above cases, give the digital frequencies and indicate if they have aliases in the
range 0 f 20 kHz.

Figure 1: Block Diagram for Exercise 1

1
Figure 2: Finding ytran (n)

Figure 3: Generating a Pulse Input

(2) Consider the digital filter given by the

y(n) = 1.7654y(n 1) 0.81y(n 2) + x(n) + 0.5x(n 1)

(a) Using Simulink, assuming fsamp = 10 kHz, and a simulation time of 10 msec, find the step
response.

(b) Determine the steady-state value, Go . Hence, plot the transient response, ytran . (Hint:
Use the model shown in Figure 2.)

(c) If the input is a pulse equivalent to x(n) = u(n)u(n + 40), find the pulse duration in
msec, and hence determine the pulse response. (Hint: Use the model shown in Figure 3).

(3) It is required to design an anti-aliasing lowpass filter to filter out frequencies in the frequency
band f 5 kHz. The requirements are as follows:

The pass-band frequency edge fp = 4.7 kHz

The stop-band frequency edge fs = 5 kHz

The stop-band attenuation s = 40 dB

The Order of filter n=8.

2
Figure 4: Data Acquisition System

(a) Choose the approximation that gives the best results.

(b) Determine the pass-band attenuation p .

(c) Find the transfer function and hence plot the magnitude and phase responses of your
design.

(d) For your design, what will be the order of the filter you designed if Butterworth, Chebychev,
or Elliptic filter approximations are used? Comment.

(e) In order to test the anti-aliasing lowpass filter, construct the model shown in Figure 4,
which represents a part of a data acquisition system. Assume that the digital filter is given
by the following difference equation:

y(n) = 0.5335y(n 1) 0.7265y(n 2) + 0.8633[x(n) + 0.618x(n 1) + x(n 2)]

What is the type of this digital filter? Test for stability. Plot the magnitude and phase
responses.

(f) Simulate the model using Simulink for input frequencies fi = i kHz, i = 1, 2, . . . , 7. What
is the frequency where the output is zero? Verify that there is no aliasing. Investigate the
different waveforms seen on the screen of the scopes and comment.

(4) In this exercise, we would like to model an A/D converter with the following parameters:

Number of bits is nb

Full scale-level is Vref = 5 V . (This means that the dynamic range is Vref )

Sampling frequency of 12 kHz.

3
Figure 5: Block Diagram for Exercise 4

The model is shown in Figure 5.

(a) For the following values of the parameters, model the A/D converter and plot the transfer
characteristics. Hint: Use one period of a low frequency signal (1 Hz).

nb = 4 bits
nb = 8 bits

(b) For an analog input sinewave of frequency 7 Hz and amplitude = Vref (quantization
step), plot the output and the quantization noise signals for both cases of part (a).

(c) Calculate the quantization average power and hence the S/N ratio in dB of the output
signal. Hint: Use about 10 cycles of the sinewave in order to calculate the average power.

(5) Consider the following continuous-time signal

xa (t) = xa1 (t) + xa2 (t) + xa3 (t),

where,

xa1 (t) = 16 sin4 (2f1 t ) + 2 cos(2f4 t),
3

xa2 (t) = 6 cos(2f2 t) sin(2f3 t + ),
4

xa3 (t) = 12 cos(2f5 t) cos(2f6 t + ),
3

4
f1 = 50 Hz, f2 = 200 Hz, f3 = 800 Hz, f4 = 1500 Hz, f5 = 400 Hz, and f6 = 800 Hz. It is
required to design a digital signal processing-based system to separated the signals xa1 (t) and
xa3 (t) from the signal xa (t). Assume that the attenuation in the passband p = 1 dB and
s = 48 dB in the stopbands.

(a) Determine the minimum required sampling rate fsamp(min) . Hence, use twice this value.

(b) Draw a block diagram of the system indicating the requirements of each block (use the
minimum possible number of blocks and filters).

(c) Design and write the difference equations of the digital filters needed (show only 6 terms).

(d) Plot the attenuation (in dB) response of each filter to verify your design.

You might also like