modsim 2

42
Faculty of Life Sciences and Computing Mobile Communications Systems – Lab 1. ModSim p1 2. Introduction to CommSim p14 3. Session 1 - CommSim Tutorial p15 4. Session 2 - AM generation and detection p21 5. Session 3 - SSBSC Generation and Detection p29 6. Session 4 - FM Generation and Detection p35

Upload: aziz-london

Post on 08-Aug-2015

43 views

Category:

Documents


0 download

DESCRIPTION

report

TRANSCRIPT

Page 1: modsim 2

Faculty of Life Sciences and Computing

Mobile Communications Systems – Lab

1. ModSim p1

2. Introduction to CommSim p14 3. Session 1 - CommSim Tutorial p15 4. Session 2 - AM generation and detection p21 5. Session 3 - SSBSC Generation and Detection p29 6. Session 4 - FM Generation and Detection p35

Page 2: modsim 2

©Prof. B.S. Virdee 2012 1

ModSim Lab

This lab is designed for users having a basic knowledge of electronic theory and circuits to acquire familiarity and a thorough understanding of the measurement techniques as well as the theory, technology and terminology of Amplitude Modulation and Frequency Modulation. Part 1. To invoke the lab software package click the mouse on the AM Fundamentals icon.

Following the instructions prompted. In the main menu go through each module of the course, i.e. Why Modulation, Modulation Basics, Amplitude Modulation, Modulation Index, Modulation and Demodulation, and DSBSC & SSB. Then answer the review quiz in the proceeding pages.

Part 2. Invoke the FM Fundamentals icon.

In the main menu go through each module of the course, i.e. Modulation Basics, Narrowband FM, Frequency Modulation, Phase Modulation, Modulation Measurement, and Modulation and Demodulation. Then answer the review questions in the proceeding pages.

AM Fundamentals.lnk

FM Fundamentals.lnk

Page 3: modsim 2

©Prof. B.S. Virdee 2012

2

AM Modulation

Describe the reasons for using modulation to transmit baseband information signals? What is the limitation of transmitting directly a baseband signal? Relate AM, FM and PM to the following expression: ( ) ( )φω += tcosAte c . Which variable in the expression ( ) ( ) ( )( ) ( )[ ]φωω thttgtcostfte c +∆+=

(i) Provides the best signal fidelity at the receiver (ii) Broadcast to the largest number of people at the least cost (iii) Transmit the maximum amount of information within a restricted bandwidth

Page 4: modsim 2

©Prof. B.S. Virdee 2012

3

Page 5: modsim 2

©Prof. B.S. Virdee 2012

4

What is modulation index m? Sketch an AM signal with m = 0, m = 0.5, m = 1 Sketch an AM signal with over modulation. What parameters characterize DSB? What is modulation distortion? What is SSB?

Page 6: modsim 2

©Prof. B.S. Virdee 2012

5

Page 7: modsim 2

©Prof. B.S. Virdee 2012

6

Page 8: modsim 2

©Prof. B.S. Virdee 2012

7

Page 9: modsim 2

©Prof. B.S. Virdee 2012

8

FM and PM Modulation

Page 10: modsim 2

©Prof. B.S. Virdee 2012

9

Page 11: modsim 2

©Prof. B.S. Virdee 2012

10

Page 12: modsim 2

©Prof. B.S. Virdee 2012

11

Page 13: modsim 2

©Prof. B.S. Virdee 2012

12

Page 14: modsim 2

©Prof. B.S. Virdee 2012

13

Page 15: modsim 2

©Prof. B.S. Virdee 2012 14

Introduction To CommSim

These sessions will be spent using the CommSim (Communication Systems Simulation) package, which permits easy simulation of communication functions and systems. Session 1 will be tutorial one, to get you familiar with CommSim. You will work on your own at a PC doing some simple exercises with full instructions. You will then do a slightly harder exercise with less detailed instructions; it will simulate a signal composed of a product of two sinusoids and involves most of the skills needed for later exercises. There will be no report required for Session 1. It is thought that two hours will be adequate time to complete Session 1; you may even be able to get started on the work for Session 2. Please arrive on time for Session 1, which will start with a talk by lab supervisors on various system details. (If you miss it, you may have trouble even logging on.) Session 2 to 4 will have you using CommSim to perform a variety of communication-systems functions and get hard copy of the resulting waveforms and spectra, otherwise sketch neatly. Each student will perform, working on their own, three exercises. While you are welcome to perform exercises of your own devising (and such attempts will be highly regarded), our experience is that it is not easy to choose all parameters appropriately at the first attempt, and the whole lot often has to be repeated. Accordingly, unless you are particularly confident, we suggest that you basically follow the course suggested in the following handout. Make sure that every printout you make includes your name and the date somewhere, perhaps in the header as detailed for Session 1. Make sure also that every waveform is fully labelled. Make each screen as useful as possible before printing it. Keep your own record of all parameters which do not appear on a printout, or manually incorporate them on the screen, for example by adding a descriptive title at the end of the header and notes on details of the plots at the end of the footer – but such comments are not permanently attached to the file – or using a label. Since CommSim files are stored in only a few kilobytes each, feel free to save each version of any file separately; this has the advantage that an identifying file name will be attached to each printout. For each file name use the format xxxxp1s1a; where xxxx is your name, p1 for Practical Session 1, s1a for Section 1, Figure 1a; this should identify each printout uniquely. A report will be required for Session 2-4 in week 10. Make sure that your report is self-contained, with an introduction to the relevant theory and with frequent reference, in detail and with associated calculations, to how the results support the theory.

Page 16: modsim 2

©Prof. B.S. Virdee 2012

15

Session 1 - CommSim Tutorial

CommSim is a package that simulates communication systems. The purpose of this tutorial is to introduce you to CommSim, getting you to near the point where you could devise and test your own implementation of a complex communication system. CommSim is installed for each PC in the laboratory. Log on at a convenient computer. Launch CommSim by double clicking the Commsim 7 icon

Commsim 7

(or Start | Programs | Commsim 7 | Commsim 7 | left-click). Use the full screen. There may be a pane on the left, labelled Diagram 1, which is not much use; left-click-drag its right boundary left to conceal it if necessary. At the top is a menu bar, which lets you do almost anything. Check out the dropdown windows. File: The usual. Edit: Note Repaint Screen, Preferences. In the latter, tick Snap to Grid. Simulate: Under Simulation Properties, for the moment choose a Frequency of 4096000 Hz

to End at 0.002 seconds (then enter OK), both for Defaults and Range. Blocks: Do a quick survey of what is available. View: Tick: Block Labels, Connector Labels, Status Bar, Tool Bar, and Presentation

Mode not Display Mode for the moment. Under Colors, choose a dark green for Wires. (We want to see them on-screen and from a black-white printer.)

Comm: Do a quick survey of the comms blocks that are available. Help: Take a quick look. (It is not always very helpful, to my mind!) Below the Menu bar are icons/shortcuts for popular functions. They are grouped into separate toolbars. Look them over: Main: The usual things to deal with files and editing the display. Hold the mouse

over the icons in turn, when a tooltip will give you a short form identification of the function and the status bar at the bottom of the screen will give you more detail.

Sim Control: Starts with a green arrowhead. CommSim runs a simulation

on sampled data, and these icons control the simulation.

Producer blocks: That is, blocks that produce signals, starting with [1] (a constant).

Consumer blocks: That is, blocks that accept signals, starting with [0] (display) and plot.

Page 17: modsim 2

©Prof. B.S. Virdee 2012

16

Annotation blocks: Starting with label. Arithmetic blocks: Starting with abs.

Boolean blocks: Starting with [>].

Do a quick survey of all the above icons. Now start using CommSim. Left-click-release the sinusoid icon Locate the mouse at a convenient point and left-click-release again to add a sine-wave generator

to the diagram. Do the same for a plot icon . Right-click-release the sine-wave generator to set up its properties. Give it an amplitude of 1V at 1000 Hz and label it appropriately using the “label” icon. Move the cursor over the output lead of the sine-wave generator until it becomes an upright arrow. Left-click-drag a wire from there to the dark blue input arrowhead (2nd down) of the plot block. Move the cursor to an edge of the plot block (double arrow) and left-click-drag the edges in turn to make the block a more appropriate size and shape. Click the green-arrowhead icon to run a simulation. Move the cursor to the input of the plot block and drag the wire from the blue to the light-green input. Run the simulation again and note the difference. Drag the wire to an empty spot on the diagram and release the mouse button to remove the wire. Now reconnect the wire from the generator to the blue plot input. Run the simulation again. Right-click-release the plot block to change its properties. Under Axis, change the Y scale limits to +2 and -2, and the X scale limits from 0 to 0.5 msec. (use Time Scaling). Label the Y-axis and the plot block; Title will label the whole block, while Subtitle may be used to identify individual waveforms. Left-click OK and check the effect; note that no simulation run was needed. Run the simulation again and note that the axes lose your settings. In the plot block properties, under Options, choose Fixed Bounds; change the axes as above and run a simulation, noting that the Y-axis does not change this time but the X-axis does, to display all samples. Move a block to some other spot by moving the cursor over the block (arrowed cross) and left-click-dragging the block elsewhere. Note how the wire moves with the block.

Page 18: modsim 2

©Prof. B.S. Virdee 2012

17

Use shift-left-click to select the sine-wave block, and type <Delete> to remove it (and the attached wire). Recover it (but not the wire) with Edit | Undo. Note that you need to click elsewhere to deselect.

Add a 4 kHz sine-wave generator (1V) and a summing junction

++

to the diagram. Make connections to add the two sine waves and display the result as an orange trace (2nd plot input up). Display the 1 kHz sine wave in blue (2nd plot input down). You may need to shuffle the blocks around somewhat to get a good clear schematic with no wires or labels or blocks obscured. Try to make as many wires as possible have no corners. Run the simulation. (The two trace colours suggested are easily distinguished on the screen and on a black-white print, where one is near black and the other dotted dark grey.) See schematic diagram below. Try selecting a set of blocks by left-clicking to their top left and dragging a dotted box over the selected part of the diagram. Move the selected section a little to check.

Add your name and the date and time to the diagram, so that your printout can be identified; go to File | Page Setup, then in the Header section after $F put a few spaces, then your name in full and ID number, then put a few spaces and add from the selection arrow $D (date/time). Choose Landscape and Fit Diagrams to Page. Check that all is well with File | Print Preview, then save and print your diagram. You should choose a resolution of 600 rather than 300 dots per inch. Incidentally, if at some time you need more than one plot block, a good idea is to get one just as you want it, then Edit | Copy and Paste (or Ctrl+C and Ctrl+V) it to get more of just the same size and properties. (But use a new block for your first spectrum, perhaps.)

Page 19: modsim 2

©Prof. B.S. Virdee 2012

18

Exercise

Now do a simple exercise without detailed instructions. The aim is to demonstrate that, if cosine waves at frequencies f1 and f2 are multiplied together, the resultant is the sum of cosine waves at frequencies (f1+ f2) and (f1- f2):

( ) ( )tcostcostcostcos2 212121 ω−ω+ω+ω=ωω f1 = 4 kHz and f2 = 5 kHz are appropriate values. Include blocks to perform the multiplication and the sum mentioned, and compare the results. Plot plenty of waveforms, using no more than 2 per plot (dark blue and orange) and making the truth of the proposition very clear to see. Make sure that your name and the date/time are included on the printout page.

Now add a different layer of proof by determining the spectrum of the product signal. Change the Simulation Properties | Range to run for 8 msec (0.008s) at 4.096 MHz (4096000 Hz), then press OK. Choose a spectrum analyser block using Comm | Operators | Spectrum (Real) and add it to the diagram. Right-click-release it to set up values of Trigger Mode - Triggered, Spectral Output - Magnitude / Phase, FFT Size - 32k, Output Freq Units - kHz, FFT Window Type - Rectangular, Power Spectrum Units - dBm/Hz, Load - 1 ohm, Number of FFT Averages 1, ignore Unwrap Phase and Remove Linear Phase. Set-up a trigger to start the analysis using Comm | Signal Sources | Impulse and connect its output to the Trg input of the analysis block. Add a plot block to display the spectrum; right-click the plot block and select External Trigger, which will now be a (red or green) circle above the normal inputs.

Page 20: modsim 2

©Prof. B.S. Virdee 2012

19

Connect Trg, Mag() and freq() from the analysis block to the trigger input, the blue input and the pink (magenta; 4th arrowhead down) input respectively of the plot block. Note that two of the wires are thick, to denote that they are vectors, not simple signals. Change the plot properties, selecting XY Plot using X-axis value 4. Insert labels, noting that the X-axis is now trace 4. Make sure that the axis values are unbounded. Run the simulation. The spectrum display will not have very appropriate axes, so you will need to change them; with appropriate choices you can zero in on the exact values of the peaks of the response, for comparison with theory. Note however that there may be a bug in the software that sometimes ruins the plot if the vertical axis is changed appreciably, so you may be unable to print with your preferred axes. (Sometimes the screen display is OK but the print not, sometimes the reverse.) Even better, perhaps, is to right-click the spectral plot, then Save Data to File. This file will be a simple list of x-y values; it is very long, but it is easy to delete large slabs of useless data and produce a compact table of the vital data. For better printing from Notepad, if that is what *.dat files open to, use Edit | Set Font. Another ploy is to read off x and y values using cross-wires: right-click the plot block and click Read Coordinates, when you can record quite precise values (particularly if you zoom in on a relevant section of waveform by altering the axis limits). You may like to save your diagram at this stage, as what follows may make it too crowded, and you may like to remove some plots.

Another proof of the proposition is to put the product signal through a filter to select one or other of the predicted Fourier components, and check that the output is as predicted. Add a filter to the diagram using Comm | Filters | FIR (Finite Impulse Response). Choose Number of Taps | 8192 or 8191, Cutoff Freq 1 | 1500 or 7000 Hz for Filter Type | Lowpass or Highpass respectively, Window Type | Rectangular, OK. Connect the product signal to the input, run a simulation and plot the output. Check the result, first selecting one component and then the other (or use two different filters for simultaneous plots).

Page 21: modsim 2

©Prof. B.S. Virdee 2012

20

Note that, if you finish early after thoroughly checking all of the above, you may start on the work for Practical Session 2. You should probably start with the topic whose theory you understand best, and prepare for the other exercises in the intervening week by studying the theory behind them.

Page 22: modsim 2

©Prof. B.S. Virdee 2012

21

Session 2 - AM generation and detection

Use Simulation Properties | Frequency 4096000 Hz, End at 0.002 sec. • Generate AM by multiplying a carrier by a suitable signal

( ) ( ){ }( ){ } t10162sint1012cos12

tsintcosm1Vte33

cmcAM

××π××π+=

ωω+=

Set up a carrier at 16 kHz with amplitude 1; make it a sine wave. Set up a message signal at 1 kHz with amplitude 1; make it a cosine wave. Add a dc constant voltage of 2 V to the message signal (constant [2], summing junction [Σ]). Multiply this sum by the carrier ([x]); plot the waveform.

ph

16 kHz Sine (1 V)

ph

1 kHz Cosine (1 V)

*

2

++

Plot

Time (sec)0 .0005 .001 .0015 .002

-3

-2

-1

0

1

2

3

Modify to get 100% modulation with the same carrier component and plot these waveforms. Above m = Vm/Vc = ½. For modulation depth of 100%, Vm = Vc, i.e. make Vm = ?.

ph

16 kHz Sine (1 V)

ph

1 kHz Cosine (2 V)

*

2

++

Plot

Time (sec)0 .0005 .001 .0015 .002

-3

-2

-1

0

1

2

3

Page 23: modsim 2

©Prof. B.S. Virdee 2012

22

• Generate AM by adding a DSBSC signal to a carrier To get the DSBSC signal multiply the carrier with the message signal using no dc voltage offset. To generate an AM signal use a summing junction to add the DSBSC to a carrier. Use cosine waves where possible. Choose values to get 40% modulation with a peak voltage of 2⋅8.

ph

16 kHz Sine (2 V)

ph

1 kHz Sine (400 mV)

++

*

Plot

Time (sec)0 .0005 .001 .0015 .002

-3

-2

-1

0

1

2

3

• Plot the spectrum of the AM signal Increase the simulation time to 0.008 sec. Add a spectrum analyser to the screen. (Comm | Operators | Spectrum (Real)) Triggered, 32 k, Rectangular, kHz, dBm/Hz, 1 ohm Add a (new) plot block to the screen to display the spectrum. External Trigger, X-Y Plot, X-Axis 4 Label the plot and the axes. Add an Impulse at t=0 (Comm | Signal Sources | Impulse) to trigger the spectral analysis. Connect three outputs of the analysis block to the plot block (trigger, blue and pink). Run a simulation and change the axes of the various plots for an appropriate display. Check up to 40 kHz and explain what you see (or don't see).

Page 24: modsim 2

©Prof. B.S. Virdee 2012

23

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Impulset= 0.

Plot

14000 15000 16000 17000 18000-400

-300

-200

-100

0

Plot

Time (sec)0 .002 .004 .006 .008

-3

-1

1

3++

*

ph

1 kHz Cosine (400 mV)

ph

16 kHz Sine (2 V)

• Recover the modulation signal from the AM using synchronous detection Multiply the AM signal by an in-phase carrier and put the output through a low-pass filter (Comm | fIlters | IFR). (Comment on the parameters suggested below.) Use Number of Taps 2048, Cutoff Freq 4000 Hz, Filter Type Lowpass, Window Type Rectangular. Plot all waveforms, perhaps starting at 1 msec. to avoid the filter transient. You may like to establish a fine grid, or add a negative dc voltage, or use a high-pass filter (but this is not as easy as it looks!), to measure the amplitude of the demodulated signal. Or you may save the data as a file, and get the peak output values from the file. Or you may use cross-wires to read off x and/or y values.

Page 25: modsim 2

©Prof. B.S. Virdee 2012

24

You may now like to save this version of the file, then remove a few plots, perhaps only leaving the AM signal.

Plot

Time (sec)0 .002 .004 .006 .008

-1

0

1

2

3out2048 Tap 4 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6*

ph

16 kHz Cosine (2 V)

ph

1 kHz Cosine (400 mV)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-3

-1

1

3

Plot

14000 15000 16000 17000 18000-400

-300

-200

-100

0

100Impulset= 0.

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Page 26: modsim 2

©Prof. B.S. Virdee 2012

25

• Attempt synchronous detection using a quadrature carrier As above, except multiplying the AM signal by a quadrature carrier, i.e. make carrier sine wave.

Plot

Time (sec)0 .002 .004 .006 .008

0

1

2

3out2048 Tap 4 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6*

ph

16 kHz Sine (2 V)

ph

1 kHz Cosine (400 mV)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-3

-1

1

3

Plot

14000 15000 16000 17000 18000-400

-300

-200

-100

0

100Impulset= 0.

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Page 27: modsim 2

©Prof. B.S. Virdee 2012

26

• Attempt synchronous detection using an off-frequency carrier As above, except using a carrier at 16250 Hz.

ph

16.25 kHz Cosine (2 V)

Plot

Time (sec)0 .002 .004 .006 .008

1.0

1.5

2.0

2.5

3.0out2048 Tap 4 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6*

ph

16.25 kHz Cosine (2 V)

ph

1 kHz Cosine (400 mV)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-3

-1

1

3

Plot

14000 15000 16000 17000 18000-100-80-60-40-20

020

Impulset= 0.

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Page 28: modsim 2

©Prof. B.S. Virdee 2012

27

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Impulset= 0.

Plot

14000 15000 16000 17000 18000-400

-300

-200

-100

0

100

Plot

Time (sec)0 .002 .004 .006 .008

-3

-1

1

3++

*

ph

1 kHz Cosine (400 mV)

ph

16.25 kHz Sine (2 V)

* Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6

out2048 Tap 4 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

1.0

1.5

2.0

2.5

3.0

Page 29: modsim 2

©Prof. B.S. Virdee 2012

28

• Recover the modulation signal from the AM using rectification

(Blocks | Arithmetic | abs) and filtering (as above).

ph

16 kHz Cosine (1.7 V)

ph

1 kHz Cosine (400 mV)

++

Plot

Time (sec)0 .002 .004 .006 .008

-3

-2

-1

0

1

2

3

*

*

Plot

Time (sec).002 .004 .006 .008

.50

.75

1.00

1.25

1.50out

2048 Tap 4 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

0

1

2

3

4

5

abs

Page 30: modsim 2

©Prof. B.S. Virdee 2012

29

Session 3 - SSBSC Generation and Detection

Use Simulation Properties | Frequency 4096000 Hz, End at 0.008 sec. • Generate a SSBSC signal using in-phase and quadrature carrier and modulation Use 16 kHz for the carrier and 1 kHz for the modulation. You'll have to watch the various phases. Generate the AM wave as above by summing ([Σ]) the 1 kHz to 1V dc and then multiplying ([x]) with the carrier. Then AM wave is then filtered using a filter (Comm | filters | IIR) 4th order Chebyshev II bandpass filter. Choose the lower and upper cutoff frequencies to select the lower sideband, i.e. 14-16 KHz.

ph

16 kHz Sine (2 V)

ph

1 kHz Sine (2 V)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8

++

1

4th Order 14 - 16 kHzChebyshev Bandpass

Plot

Time (sec)0 .002 .004 .006 .008

-5.0

-2.5

0

2.5

5.0

• Check the spectrum Increase the simulation time to 0.008 sec. Add a spectrum analyser to the screen. (Comm | Operators | Spectrum (Real)) Triggered, 32 k, Rectangular, kHz, dBm/Hz, 1 ohm Add a (new) plot block to the screen to display the spectrum. External Trigger, X-Y Plot, X-Axis 4 Label the plot and the axes. Add an Impulse at t=0 (Comm | Signal Sources | Impulse) to trigger the spectral analysis. Connect three outputs of the analysis block to the plot block (trigger, blue and pink). Run a simulation and change the axes of the various plots for an appropriate display. Check up to 40 kHz and explain what you see (or don't see).

Page 31: modsim 2

©Prof. B.S. Virdee 2012

30

ph

16 kHz Sine (2 V)

ph

1 kHz Sine (2 V)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8

Plot

14000 15000 16000 17000 18000-30

-20

-10

0

10

20Impulset= 0. Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

++

1

4th Order 14 - 16 kHzChebyshev Bandpass

Plot

Time (sec)0 .002 .004 .006 .008

-5.0

-2.5

0

2.5

5.0

• Make a small change to generate the other sideband What is it? • Check the spectrum

Page 32: modsim 2

©Prof. B.S. Virdee 2012

31

Choose the lower and upper cutoff frequencies to select the both the sidebands, i.e. 14.9-17.1 KHz.

ph

16 kHz Sine (2 V)

ph

1 kHz Sine (2 V)

*

++

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8

Plot

14000 15000 16000 17000 18000-30

-20

-10

0

10

20

Impulset= 0. Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

++

1

4th Order 14.9 - 17.1 kHzChebyshev Bandpass

Plot

Time (sec)0 .002 .004 .006 .008

-6-4-202468

• Recover the modulation signal from the SSBSC using synchronous detection Multiply the SSBSC signal by a carrier and put the output through a low-pass filter. (Comment on the parameters suggested below.) Use Number of Taps 2048, Cutoff Freq 4000 Hz, Filter Type Lowpass, Window Type Rectangular. Plot all waveforms, perhaps starting at 1 msec. to avoid the filter transient. You may like to establish a fine grid, or add a negative dc voltage, or use a high-pass filter (but this is not as easy as it looks!), to measure the amplitude of the demodulated signal. Or you may save the data as a file, and get the peak output values from the file.

Page 33: modsim 2

©Prof. B.S. Virdee 2012

32

Plot

Time (sec)0 .002 .004 .006 .008

-6-4-2024684th Order 15 - 17 kHz

Chebyshev Bandpass

1

++

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Impulset= 0. Plot

14000 15000 16000 17000 18000-30

-20

-10

0

10

20

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8++

*

ph

1 kHz Sine (2 V)

ph

16 kHz Sine (2 V)

Plot

Time (sec)0 .002 .004 .006 .008

-10

0

10

20

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6

*

out2048 Tap 4 kHzLowpass FIR

Page 34: modsim 2

©Prof. B.S. Virdee 2012

33

• Attempt synchronous detection using a quadrature carrier As above, except multiplying the SSBSC signal by a quadrature carrier.

Plot

Time (sec)0 .002 .004 .006 .008

-6-4-2024684th Order 15 - 17 kHz

Chebyshev Bandpass

1

++

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Impulset= 0. Plot

14000 15000 16000 17000 18000-30

-20

-10

0

10

20

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8++

*

ph

1 kHz Sine (2 V)

ph

16 kHz Cosine (2 V)

Plot

Time (sec)0 .002 .004 .006 .008

-10

0

10

20

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6

*

out2048 Tap 4 kHzLowpass FIR

Page 35: modsim 2

©Prof. B.S. Virdee 2012

34

• Attempt synchronous detection using an off-frequency carrier As above, except using a carrier at 16250 Hz.

Plot

Time (sec)0 .002 .004 .006 .008

-6-4-2024684th Order 15.25 - 17.25 kHz

Chebyshev Bandpass

1

++

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Impulset= 0. Plot

14000 15000 16000 17000 18000-30

-20

-10

0

10

Plot

Time (sec)0 .002 .004 .006 .008

-8

-4

0

4

8++

*

ph

1 kHz Sine (2 V)

ph

16.25 kHz Sine (2 V)

Plot

Time (sec)0 .002 .004 .006 .008

-10

0

10

20

Plot

Time (sec)0 .002 .004 .006 .008

0

2

4

6

*

out2048 Tap 4 kHzLowpass FIR

Page 36: modsim 2

©Prof. B.S. Virdee 2012

35

Session 4 - FM Generation and Detection

Use Simulation Properties | Frequency 4096000 Hz, End at 0.002 sec. • Generate AM by adding a DSBSC signal to a carrier Set up a carrier at 16 kHz with amplitude 2; make it a cosine wave. Set up a message signal at 1 kHz; make it a cosine wave. Use a multiplier ([x]) to get the DSBSC signal, and a summing junction ([Σ]) to add a carrier. Right-click-release the plot block to change its properties. Under Axis, change the Y scale limits to +3 and -3, and the X scale limits from 0 to 2 msec. (use Time Scaling). Use cosine waves where possible. Choose values to get 40% modulation with a peak voltage of 2·8 V.

Plot

Time (msec)0 .5 1 1.5 2

-3

-1

1

3++

*

ph

1 kHz Sine (400 mV)

ph

16 kHz Cosine (2 V)

• Make a small change to produce narrowband FM What is it?

-X

ph

16 kHz Cosine (2 V)

ph

1 kHz Sine (400 mV)

*

++

Plot

Time (msec)0 .5 1 1.5 2

-3

-1

1

3

Page 37: modsim 2

©Prof. B.S. Virdee 2012

36

• Check the amplitude modulation and phase deviation of this signal For example, compare it directly with the original carrier.

Plot

Time (msec)0 .1 .2 .3 .4 .5

-3

-1

1

3++

*

ph

1 kHz Sine (400 mV)

ph

16 kHz Cosine (2 V)

-X

Right-click-release the plot block to change its properties. Under Axis, change the X scale limits from 0 to 0.5 msec. (use Time Scaling). • Set up a wideband FM signal

( ) ( ) ( )( )t102cos2t10162sin1tcosff

tsinEte 33m

m

cccFM ×π−××π=⎟⎟

⎞⎜⎜⎝

⎛ω

∆−ω=

Get an FM modulator (Comm | Modulators - Real | FM(Re)). Suitable parameters are Translation Frequency (Hz) 16000 (the carrier frequency), Amplitude (V) 1, Initial Phase (deg) 90, FM Deviation (Hz/V) 1000. Provide a sine-wave source at 1 kHz to modulate this carrier, and set it to produce a frequency deviation of ±2 kHz.

ph

1 kHz Cosine (2 V)

Plot

Time (msec)0 .1 .2 .3 .4

-1.0

-.5

0

.5

1.0sig

ph

FM ModFc= 16 kHz

Right-click-release the plot block to change its properties. Under Axis, change the Y scale limits to +1 and -1, and the X scale limits from 0 to 0.4 msec. (use Time Scaling).

Page 38: modsim 2

©Prof. B.S. Virdee 2012

37

• Check the frequency deviation To do this, you need to compare lots of half-periods of the signal.

ph

1 kHz Cosine (2 V)

Plot

Time (msec).12 .14 .16 .18 .2

-1.0

-.5

0

.5

1.0sig

ph

FM ModFc= 16 kHz

sig

ph

FM ModFc= 16 kHz

ph

1 kHz Cosine (3 V)

sig

ph

FM ModFc= 16 kHz

ph

1 kHz Cosine (4 V)

sig

ph

FM ModFc= 16 kHz

ph

1 kHz Cosine (5 V)

Right-click-release the plot block to change its properties. Under Axis, change the Y scale limits to +1 and -1, and the X scale limits from 0.12 to 0.2 msec. (use Time Scaling). The circuit below will produce a suitable timebase for this purpose. It generates a narrow pulse soon after the input (the FM signal) crosses through zero, and this triggers a sweep of 1 V/msec. until the next zero crossing of the input. The numbered boxes are constants. [>], [<] and 'and' ([∩ ]) are standard icons. The 1/S block is an integrator (Blocks | Integration | resetIntegrator); leave its various parameters equal to 0. Just for this section, use Simulation Properties | Frequency 40960000 Hz (40·96 MHz), End at 0.002 sec. Plot the signal (y) against this timebase (x) and calculate the extreme frequencies from this plot. Don’t forget to Externally triggering the plot.

>

0.005 <

and Output0.000

(analogue)Signal

1/S

1000

0r

b

Page 39: modsim 2

©Prof. B.S. Virdee 2012

38

0

1000

0.005

01/Sb

rand

<lr

>lr

ph

1 kHz Cosine (12 V)

Plot

Time (msec)0 10000000 30000000

-1.0

-.5

0

.5

1.0sig

ph

FM ModFc= 16 kHz

Right-click-release the plot block to change its properties. Under Axis, change the Y scale limits to +1 and -1, and the X scale limits from 0 to 40000000 msec. (use Time Scaling).

• Check the spectrum Use Simulation Properties | Frequency 4096000 Hz, End at 0.008 sec. Add a spectrum analyser to the screen. (Comm | Operators | Spectrum (Real)) Triggered, 32 k, Rectangular, kHz, dBm/Hz, 1 ohm Add a (new) plot block to the screen to display the spectrum. External Trigger, X-Y Plot, X-Axis 4 Label the plot and the axes. Add an Impulse at t=0 (Comm | Signal Sources | Impulse) to trigger the spectral analysis. Connect three outputs of the analysis block to the plot block (trigger, blue and pink). Run a simulation and change the scales of the various plots for an appropriate display. Check up between 10 to 22 kHz and explain what you see. You may like to store the data values in a file so that the precise values are available. You may use the following values of the Bessel function in predicting the spectrum:

J0(2) = 0⋅223891 J1(2) = 0⋅576725 J2(2) = 0⋅352834 J3(2) = 0⋅128943 J4(2) = 0⋅033996 J5(2) = 0⋅007040 J6(2) = 0⋅001202 J7(2) = 0⋅000175

Page 40: modsim 2

©Prof. B.S. Virdee 2012

39

sig

ph

FM ModFc= 16 kHz Plot

Time (msec)0 200000 600000 1000000

-1.0

-.5

0

.5

1.0ph

1 kHz Cosine (2 V)

>lr

<lr

and 1/Sbr

0

0.005

1000

0

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

Plot

10 12 14 16 18 20 22-100-80-60-40-20

020

Impulset= 0.

Right-click-release the top plot block to change its properties. Under Axis, change the Y scale limits to +1 and -1, and the X scale limits from 0 to 1000000 msec. (use Time Scaling). Do same for bottom plot using the scale specified. • Demodulate the FM signal by differentiation, rectification and filtering The circuit below will give a good approximation to differentiation for this purpose. Get the delay from Comm | Operators | Delay (Real) and set the delay value to 2 SIM Steps. [-X] and [Σ] are standard icons.

Σ

+

+Signal

Delay (2) -X

Output

The rectification is done by Blocks | Arithmetic | abs. Use a FIR filter. (Comment on the parameters suggested below.) Use Number of Taps 4096, Cutoff Freq 1500 Hz, Filter Type Lowpass, Window Type Rectangular.

Page 41: modsim 2

©Prof. B.S. Virdee 2012

40

Impulset= 0.

Plot

10 12 14 16 18 20 22-100-80-60-40-20

020

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz)

0

1000

0.005

01/Sb

rand

<lr

>lr

ph

1 kHz Cosine (2 V)

Plot

Time (msec)0 200000 600000 1000000

-1.0

-.5

0

.5

1.0

sig

ph

FM ModFc= 16 kHz

Delay (2) -X++

abs out4096 Tap 1.5 kHzLowpass FIR

Plot

Time (sec)0 .002 .004 .006 .008

.028

.030

.032

.034

.036

• Demodulate the FM signal using zero-crossing pulses The circuit below will produce these pulses. Use Comm | Operators | Delay (Real).

Page 42: modsim 2

©Prof. B.S. Virdee 2012

41

>0.000Constant

>Delay (25)

and

(analogue)Signal

Output

Filter its output to recover the modulation signal.

0and

<lr

>lr

Plot

Time (sec)0 .002 .004 .006 .008

.198

.203

.208

.213out

4096 Tap 1.5 kHzLowpass FIR

Delay (25)

sig

ph

FM ModFc= 16 kHz Plot

Time (msec)0 200000 600000 1000000

-1.0

-.5

0

.5

1.0ph

1 kHz Cosine (2 V)

>lr

<lr

and 1/Sbr

0

0.005

1000

0

Trg

in

Trg

Mag[ ]

Ph[ ]

f req[ ]

32K Re FFTPower SpectralDensity(dBm/Hz) Plot

10 12 14 16 18 20 22-100-80-60-40-20

020

Impulset= 0.