Sie sind auf Seite 1von 15

EE423 Lab #2.

Procedure: Introduction to SIMULINK;


AM modulation and demodulation

1. What is SIMULINK?

Simulink is a software package that enables you to model, simulate, and analyze systems
whose outputs change over time. Such systems are often referred to as dynamic systems.
Simulink can be used to explore the behavior of a wide range of real-world dynamic
systems, including electrical circuits, shock absorbers, braking systems, and many other
electrical, mechanical, and thermodynamic systems.

Simulating a dynamic system is a two-step process with Simulink. First, a user creates a
block diagram, using the Simulink model editor, which graphically depicts time-
dependent mathematical relationships among the system’s inputs, states, and outputs. The
user then commands Simulink to simulate the system represented by the model from a
specified start time to a specified stop time.

2. Getting Started in SIMULINK

Start up the Matlab (We use Matlab version 6.5.1 in this and the following experiments.),
type “simulink” (small letters!!) in the command window.

Fig. 1

1
EE423 Lab #2.

In the “Simulink Library Browser” window, click “File”-> “New” -> “Model”

Fig. 2

2
EE423 Lab #2.

Example 1:
Simulate Sine wave f (t ) = sin( 1000 * 2π * t )

1. Create a new model window by choosing “File”-> “New” -> “Model”


2. Drag “Sine Wave” block from “Simulink” -> “Sources” to the model window;
3. Drag “Scope” block from “Simulink” -> “Sinks” to the model window;
4. Left-press the mouse when the arrow becomes a single cross by moving the
mouse near to the right side of “Sine Wave”; keep left button pressed and move
the single cross to the left side of “Scope” until you see the single cross becomes
double crosses; release the button and the tow parts are connected. Fig. 3 is the
finished diagram.
5. Click “Simulation”-> “Simulation parameters …” and refer to Fig. 4 to set the
simulation parameters.
6. Double click the “Sine Wave” and set the parameters as shown in Fig. 5
7. Press “Start simulation” to run the program
8. Double click the “Scope” and you should see the wave similar to Fig. 6
9. Refer to Fig. 7 to set the parameters of “Scope” by press “Parameters” button on
the display panel.
10. Right click on the scope; then choose “axes properties…” to set “Y” scales.
11. Now you should see the picture of Fig. 8

Fig. 3

3
EE423 Lab #2.

Fig. 4

Fig. 5

4
EE423 Lab #2.

Fig. 6

Fig. 7

Fig. 8

5
EE423 Lab #2.

Example 2:
Use the “FFT” block as Spectrum Analyzer

1. Refer to Fig. 9 to set the diagram. To add “B-FFT”, choose “DSP Blockset” ->
“DSP Sinks” -> “FFT Spectrum Scope”. Use Fig. 10 and Fig. 11 to set “FFT
Scope”. After you finish setting, the “FFT Scope” becomes “B-FFT Scope”.
2. To draw a line from an existing line to the spectrum scope, keep pressing “Ctrl”
button and then use the similar procedure of example1.
3. Use Fig. 4, Fig. 5 and Fig.7 to set environment and Sine source parameters.
4. Run the program and you should see the spectrum as shown in Fig. 12

Fig. 9

6
EE423 Lab #2.

Fig. 10

Fig. 11

7
EE423 Lab #2.

Fig. 12

8
EE423 Lab #2.

Example 3:
Product of Two Sine Waves

1. Refer to Fig. 13 to draw the system diagram. To add “ × ” product, choose


“Simulink” -> “Math Operations” -> “Product”.
2. Use Fig. 14 and Fig. 15 to set parameters of “Sine 1” and “Sine 2”
3. Run the program and you should get picture of Fig. 16 and Fig. 17

Fig. 13

9
EE423 Lab #2.

Fig. 14

Fig. 15

10
EE423 Lab #2.

Fig. 16

Fig. 17

11
EE423 Lab #2.

3. Introduction to Amplitude Modulation (AM) and Demodulation

An AM signal with a sinusoidal carrier can be represented as:

v AM (t ) = Vc [1 + ms (t )] cos ωc t

where s (t ) is the normalized message, satisfying | s (t ) | max ≤1 . The Fourier transform


of v AM (t ) is given by:

Vc V mV c mV c
V AM (ω) =δ (ω − ωc ) + c δ (ω + ωc ) + S (ω − ωc ) + S (ω + ωc )
2 2 2 2
where s (ω −ωc ) is the Fourier transform of s (t ) .

A simple demodulation technique is the envelope detection. To use envelope detection,


you should make sure that m ≤ 1 . The diagram is as below.

AM modulated Demodulated
|u(t)| BPF
signal u(t) signal s(t)

4. Simulation of AM Modulation and Demodulation

1. Message signal: s(t ) = sin( 1000 * 2π * t )


2. Carrier signal: wc (t ) = 2 cos( 10000 * 2π * t )
3. m = 0 .5
4. Fig. 18 is the system diagram. You should set block parameters yourself
(including the digital filter which is in “DSP Blockset->Filtering->Filter
Designs”. Write down these parameters in your lab report.
5. Print out the waves in Scope1, Scope2, Scope3, Scope4, Spectrum1, Spectrum2,
and Spectrum3.

12
EE423 Lab #2.

Fig. 18

13
EE423 Lab #2.

5. Another Method of Demodulating AM Signal: Synchronous


Detection

There is another method of demodulating AM signal other than the envelope detection
we used for part 5, called synchronous detection. The demodulation process is
multiplying V AM (t ) by cos ωc t :

V c [1 + ms (t )] V c [1 + ms (t )]
VAM (t ) * cos ωc t = + cos 2ωc t
2 2

Vc ms (t )
After low pass filtering and DC blocking, we get the output signal which is
2
proportional to the original signal.
This demodulating scheme can be viewed as:

AM modulated Multiply by Demodulated


BPF
signal u(t) signal s(t)

Now modify your part 5 system diagram to be as below:

14
EE423 Lab #2.

The 2 carrier signals are the same, as well as the two BPFs. Add a Mux to compare the
demodulated signals by using 2 methods respectively. Include all scope output plots in
your lab reports.

6. Questions:
Only one question in this experiment, but may be challenging:

In example3, we choose 1/51200 as the sample time. Change it to 1/50000 to see the
difference in frequency domain. Print out figures for these two cases and explain why
this difference happens.

15

Das könnte Ihnen auch gefallen