Simulink/Matlab intro to communication project

Description

You will design basic simulink designs and then answer questions related. the project also includes preliminary exercise problems that you will answer as well. your answer will be in the form of a single report that answers all the questions and has all the screenshots needed.the designs are fairly simple, you will follow the instructions in the pdfs attached which include two parts. and the report instructions are also attached.

Don't use plagiarized sources. Get Your Custom Assignment on
Simulink/Matlab intro to communication project
From as Little as $13/Page

Unformatted Attachment Preview

Sub-Project 2*: Simulink Amplitude Modulation
EEL4512C-Intro. to Communication Systems
Fall 2023
Objectives:
To simulate Amplitude Modulation (AM) and demodulation.
Introduction:
Modulation, by definition, is a process by which a certain characteristic of a fixed carrier wave is varied in
accordance with an information-bearing signal. The primary motivation for modulation is to facilitate
transmission of the information-bearing signal over a communication channel with a specific frequency
range. For example, a human voice may have frequencies between 100 and 3000 Hz, but if this signal were
to be transmitted via RF directly at those frequencies, only one voice could be transmitted at a time
without interference (and it would require an antenna the length of the United States). By modulating
and transmitting the signal at a much higher frequency, we can communicate over a much wider variety
of channels, and also share these channels with other signals.
Amplitude modulation refers to the manipulation of the amplitude of a carrier wave in some manner to
transmit the required information. In the simplest case, the information signal is multiplied by the carrier
wave, creating a new signal that has frequencies above and below the carrier wave, but none at the
original frequencies of the message signal. This is very useful for a wide array of applications, since we can
effective choose which frequency range our message gets transmitted over.
Project Source: (EE 243: Communications Systems I, Missouri S&T University, Fall 2012 by Dr. Yahong Rosa Zheng)
Procedure:
Part A – Modulation Component
To begin, open a new library by choosing New -> Model from the File menu.
For this part of the project, we will be constructing a model that performs AM modulation on a given
signal. The defining equation for AM modulation in this manner is:
( ) = (1 + ( ) )cos(2 ),
(1)
where is the amplitude of the carrier, is the frequency of the carrier, is the modulation index, and
( ) is the normalized message signal (i.e. it is modified to occupy the range between -1 and +1). This
subsystem will consist of one input, one output, and three user-changeable parameters. In order to create
this input and output, search for the blocks In1 and Out1 in the Library browser and add them to your
library. You may rename these components ( ) and ( ), respectively, for clarity.
The first part to build in this model is the normalizer, which takes the input message signal ( ) and
constrains it to fall between -1 and 1. Ordinarily, normalization would entail dividing every sample of the
signal by the absolute maximum value the signal would take. However, this is somewhat tricky to
implement in Simulink, and it runs into trouble where noisy signals are concerned. For the purposes of
this project, we will assume that you have normalized the input message signal to avoid over-modulation.
We will however clip the signal in case it falls outside the range of -1 to +1. This can be accomplished with
the Saturation block in the library. Add this block to your model and set its limits accordingly.
Figure 1 AM Modulator
After clipping, you must implement the above equation using blocks from Simulink. You should have the
necessary knowledge to build a system that computes Equation (1) based on sub-project 1 as in Figure 1.
Note that, AM modulator block does not exist in Simulink. You have to build this block.
Part B – Testing Modulator
After creating the above model set the solver to discrete time. This model file will be where we test the
modulator built in the previous step.
To test this model, create a sine wave block and connect it to the input of the modulator. Set its amplitude
to 1 and its frequency to 5 Hz. Now, in the modulator parameters, set the carrier amplitude to 1 and the
modulation index to 0.5. Set the carrier’s frequency to around 40 times the frequency you set for the
source sine wave. Connect a scope to the output, then set it to accept two inputs so that you can view the
original source sine wave on it at the same time. Set the max step size to 0.0001 and the simulation run
time to 20 seconds, then run it. After autoscaling the axes, you should get an output that looks like Figure
2.
Figure 2: Output of AM Modulator with = 0.5
Save a screenshot of this scope output, then change the modulation index to 0.8 and run it again. Also
save screenshots of the scope outputs for modulation indices of 1 and 1.5. Comment on the effects the
modulation index has on the modulated signal. Finally, set the modulation index back to 1, but set your
sine wave source amplitude to 2. You should notice the clipping effect on the final output.
Note: by creating a sub-system out of your blocks and adding mask, you don’t need to manually change
all the individual parameters. For simplicity, you are not required to create the subsystem in the library
but if you like you can.
Next, connect a Spectrum Analyzer (Remember part C in sub-project 1) to the output of the modulator
and observe the resulting spectrum. There should be a large impulse at the carrier frequency, along with
two smaller ones on either side which correspond to the message signal.
Part C – AM Demodulation
We are now going to create a demodulator block. An AM demodulator can be constructed by multiplying
the output of the modulator by another cosine wave equal to the frequency of the original carrier, then
low-pass filtering the result. This is known as a product detector. To begin, place the blocks seen in Figure
3 in your model window, then configure the parameters.
Figure 3: AM Demodulator
Essentially, this block multiplies the modulated signal by a cosine wave at the carrier frequency, then
prepares to filter the result by sampling at regular intervals specified by Fs by using a zero-order hold
block. The parameter configuration for the Analog filter should be as follows:
Figure 4: Parameter Configuration for LP Filter
After designing the block as in Figure 5, connect it to the output of your modulator. Add another input
to the scope, then connect it and run the simulation. You should obtain results that look similar to Figure
6.
Figure 5: AM Modulator and Demodulator
Figure 6: Final Results of AM Modulation
The output from the demodulator is going to be distorted at the beginning and slightly delayed when
compared to the original input. The reason for this is that the filter consists of a series of shift registers (in
our case, 10 of them) that all begin at 0. It takes some time for these registers to be filled, so the filter
output will not be correct until a certain amount of time has passed. The higher the filter order, the longer
this will take.
After completing the above steps, save your model files and scope outputs and submit them in your
report.
Questions (justify your answers by your simulation results):
Q1. In part B, change the carrier signal to a square wave. How does the modulated output change?
Q2. In part B, what are the consequences of setting the modulation index above 1? Will this signal be
demodulated properly, or will there be problems?
Q3. What will happen if the modulation index is set too low? How will this affect the transmission
efficiency in a real system?
EEL4512C- Introduction to Communication Systems
Electrical Engineering Department, University of South Florida
Project and Report: 100 Points



Only submit a single PDF file including both Project Parts 1 and 2.
The project should be your own work. No collaboration is allowed in project.
The following shows how the grade will be distributed among different tasks in the
project.
o Organization, clarity and writing aspects of the report [5 points]
o Project Part 1
 Preliminary Exercise [5 points]
 Part A- Show the model you created in Simulink [3 points]
 Part A-Show the output of the model [3 points]
 Part A- For each of the four tasks in Page 6 show the output and write and
discuss the parameters or block you used. Discuss your observations. [10
points]
 Part B- Show the model you created in Simulink[2 points]
 Part B- Show your model and output for sine, square and sawtooth signals
[9 points]
 Part C- Show your model and recreated signal square and sawtooth signals
[8 points]
 Post-Subproject Questions: For each question discuss the settings and
parameters that were used and tested. Answer the questions in detail and
justify them using the results of your tests.
Q1[4 points]
Q2[4 points]
Q3[7 points]
Q4[4 points]
o Project Part 2
 Part A- Show and discuss the model you built for Amplitude modulation
and its parameters. [5 points]
 Part B- Test the modulator you built and show your test model and the
output. Discuss your observations. [3 points]
 Part C- Show your Demodulation model and its output. [9 points]
 Post-Subproject Questions: For each question discuss the settings and
parameters that was used and tested. Answer the questions in detail and
justify them using the results of your tests.
Q1[6 points]
Q2[6 points]
Q3[7 points]
1
Sub-Project 1*: Intro to Simulink and Frequency Analysis
EEL4512C-Intro. to Communication Systems
Fall 2023
Objectives:
1) To learn how to build a basic model in Simulink.
2) To learn the effects of noise on a signal in Simulink.
3) To simulate signals and view their frequency domain representation.
4) To synthesize signals from their Fourier series coefficients.
Introduction: Simulink is a tool that allows us to visually create signal processing systems by
connecting individual “blocks” that describe the actions of the system. After specifying the blocks
that make the system do what we want, we can then pass any signal we want through it and view
the output on a virtual “scope” in either the time or the frequency domain.
Preliminary exercise:
The complex Fourier series coefficients are given by:
1

2
= ∫0 ( ) −
1) Find the Fourier series coefficients of a square wave of odd symmetry of amplitude V and
frequency f Hz (assume 50% duty cycle and zero DC). See below.
2) Find the Fourier series coefficients of a sawtooth wave of odd symmetry of amplitude V and
frequency f Hz (assume zero DC). See below.
3) Sketch the amplitude and phase of the Fourier series coefficients obtained in 2 & 3.
*Project Source: (EE 243: Communications Systems I, Missouri S&T University, Fall 2012 by Dr. Yahong Rosa Zheng)
Procedure:
Part A – Getting Familiar with Simulink
To open Simulink, type ‘simulink’ at the MATLAB command prompt. The Simulink library browser
will open. It consists of various blocksets specific to different applications such as
communications, signal processing, control systems, power systems etc. It is advisable to explore
the various block libraries on your own to get a good feel for the capabilities of Simulink.
In order to familiarize yourself with Simulink, you will first build a simple system by following the
steps given in this document. To open a new model, go to the File menu and select New -> Model.
A blank model will open. This will serve as your canvas to build your system model.
In the Simulink library browser, go to the Sources option and select a ‘Sine Wave’ source block.
In order to include this block in your model, click and drag the block onto your model window.
Similarly search for a ‘Gain’ block (to amplify the signal) and a ‘Scope’ block (to visualize the
signal) in the various Simulink libraries. You should find the gain block under the Commonly Used
Blocks or the Math Operations libraries. You should find the scope block in the Commonly Used
Blocks or Sinks libraries. Include both in your model window.
A1 – First Simulink Model
For this model, we need two gain blocks. In order to duplicate a block, simply right-click on the
block and drag and place this duplicate block in your model window too. We would also like to
have a ‘Switch’ block to be able to select from multiple inputs and a multiplexer block to view
multiple signals on the same scope. The multiplexer is found in the libraries as the ‘Mux’ block.
Search for these blocks in the basic libraries and include them in your model.
We also require a ‘Clock’ block to use as a decision maker for switching between two signals using
the switch. This block simply outputs the current simulation time. Look for it in the Sources library
and include it in your model window.
(Note: This is not the clock used for the synchronization of digital logic systems.)
Your model window should now have all of the blocks shown in Figure 1.
In order to begin connecting the blocks, click on the sine wave block, then hold down the CTRL
key and click on the first gain block. A connecting line will form between the two blocks. An
alternate way to do this is to place your cursor near the output port of a block until the cursor
changes into a cross-hair, then click and drag a line to the input port of the block to be connected.
The same sine wave input is to be connected to the second gain block too. In order to draw a
second branch, right-click on the original branch and drag a line to the input port of the second
gain block.
Connect the chosen blocks in the following manner.
Next, we need to set the parameters for the individual blocks. Double clicking on the blocks opens
the block parameters pane. First, double click on the sine wave source block. Set the block parameters
as given in Figure 3, and click OK to apply the settings.
Figure 3: Sine wave source parameters
Open the two gain block settings and set them up for gains of 0.5 and 3 respectively. The
switch should have the parameters shown in Figure 4 in order to change from the second gain
block output to the first after a simulation time of 5 seconds. The mux block will have two
inputs by default. The clock and scope block settings need not be altered.
To add a title to the model, double-click at the location you want to type, then type “Building
a Basic Model in Simulink”. You may use the Format menu to change the font and font size.
You may also right-click on the title box and select ‘Show Drop Shadow’ to emphasize the
title. The completed model is seen in Figure 5. Include a screenshot of the model in your lab
report.
Set the simulation parameters by selecting Configuration Parameters from the Simulation
menu. Under the Solver tab, set the solver to ‘discrete’, the stop time to 10.0, and the max
step size to 0.03. Then click OK. Now the model is ready for simulation.
Go to Simulation > Start or press to begin simulation. In order to visualize the results, double
click on the scope block. The scope output should be as shown in Figure 6. Include a
screenshot of this result in your lab report.
Figure 4: Switch block parameters
Figure 1 Scope Display
Change the frequency of the sine wave generator to 5*2*pi rad/sec (i.e. 5 Hz) and change the
phase to pi/2 rad to turn it into a cosine wave. Simulate the model and observe the scope, then
include a screenshot of the new scope output in your report. Similarly, observe the scope for the
following variations of the original model and submit the outputs in your report:
a. Change the switch block to a Product block (remove the clock).
b. Change the clock to a cosine wave of frequency 4 rad/sec, amplitude 10, and bias 5.
c. Change two or more parameters of your choice in the original model.
d. Replace one of the gain blocks with any block of your choice.
A2 – Second Simulink Model
4
1
1
Let ( ) = [sin( ) + 3 sin(3 ) + 5 sin(5 )] be your input signal.
a. Develop a Simulink model for x(t) with an included information block. Assume a 10 s
simulation time. Include the screenshot of the model in your report.
b. Display x(t) in a scope over the range 0 to 2 with labels and include the screenshot.
c. Modify the Simulink model obtained in part a by overlaying a square wave that is +1
between 0 and and −1 from to 2 and repeats thereafter. Include the screenshot of
the model in your report.
d. Display the overlay result in a scope over the range 0 to 2 with labels include the
screenshot.
Part B – Noise Effect
Random numbers can be used to simulate the noise. Let ( ) = 5 sin(2 ) + ( ), where ( )
stands for the noise.
a. Create a Simulink model of ( ). Assume a 10 s simulation time.
b. Using a scope block, display the effect of the noise on the signal and comment on it.
Notes – Simulink includes blocks for creating a sine wave, and a uniform random number
generators to generate the noise. You can find both in the Source Library. You will also need to
include an add block. Finally, add a scope to view the plotted result. For sine wave and uniform
random number generators set the parameters as shown below
Part C – Frequency Domain Analysis
In order to view the properties of a signal in the frequency domain, some different steps must be
taken. Ordinarily, a signal source will generate a single value at each point in time, which then
propagates through the entire system as Simulink processes the simulation. However, a proper
analysis in the frequency domain requires several time-domain points to be stored up and
processed at the same time, generally with an FFT block.
A handy block used to compute and display the frequency components of a signal is the Spectrum
Analyzer, found in the Signal Processing Toolbox libraries. To start using it, create a new model
and add a title of “Frequency Domain Analysis of a Signal”. Then find the spectrum scope block
in the library and add it to your new model.
Upon opening the block settings, a number of options will need to be set in spectrum settings.
Select a raw magnitude spectrum-RMS (as opposed to the PSD) and change the units to “dBW”,
and set the display options to one-sided. In order to use the standard signal sources from the
normal toolbox, it is necessary to check the Buffer Input box. When this is selected, the scope
will take time-domain samples from a source and accumulate them in a buffer until it has enough
to calculate the required FFT. Set the buffer size to 512, buffer overlap to 0, and spectral averages
to 1. Do not change any other settings from their default values.
A convenient signal source from the continuous-domain toolbox is the Signal Generator block.
This block can generate a number of different periodic signals given only an amplitude and a
frequency. Find this block and add it to your project, then open the settings. Leave the signal type
at ‘sine’ and amplitude at 1, but change the frequency to 5 Hz.
It turns out that these two blocks cannot be directly connected together due to the way Simulink
processes signals. The signal generator produces continuous-time signals, which are numerically
computed using differential equations. However, the FFT scope requires a discrete-time signal
to function, which is handled in an entirely different way by Simulink’s model solvers. In order to
convert the continuous signal into a discrete one, we require the Zero-Order Hold block. Find this
block in the library, then place it between the signal generator and the spectrum scope and
connect them together in a line. Your final model should resemble Figure 7.
There are still a few more things to do. By opening the zero-order hold settings, we can choose the
sampling period for the discrete signal. Set it to 0.01 (fs = 100 Hz). Finally, open the simulation
configuration settings and use stop time 100 and make the max step size 0.001. We are now ready to
run the simulation.
Upon finishing the simulation, the spectrum scope should pop up with the results of the FFT. For the
sine wave, there should be a single peak at 5 Hz and nothing else. It may also be a good idea to
connect a normal scope to the zero-order hold output to view the signal in the time-domain.
Now we are ready to look at a few more types of signals. Change the signal type in the generator
to ‘square’ and rerun the simulation without changing any other settings. There should be
harmonics present this time; if they are not visible, go into the scope settings and lower the
minimum Y-value. Compare the magnitudes of these harmonics to the results from the
preliminary and note your observations in your lab report. Also, include a screenshot of your
magnitude spectrum.
Next, change the generated signal to a sawtooth wave and repeat the above process, noting your
observations on the harmonics and taking a screenshot of the spectrum. Finally, change the
generator to output a random signal and record your observations on the spectrum produced.
Part D – Signal Synthesis from Fourier Series Coefficients
Given the Fourier coefficients calculated in the preliminary exercise, it is possible to reconstruct the
square wave and sawtooth wave signals using only sine wave sources. To do this, open a new model,
then create a sine wave source for the fundamental frequency of the square wave and one for each
harmonic (use as many harmonics as you feel are necessary to reconstruct the signal accurately). Set
the amplitudes, frequencies, and phases of each according to the Fourier coefficients you calculated
previously.
To add all these sine waves together, the Sum block is required. Find this block in the libraries and
add it to your project. Open the settings, and under the list of signs, add as many plus (or minus) signs
as there are signals to add. This will expand the sum block to accept several inputs. Attach a scope to
the input and observe how close the sum of sinusoids comes to representing the shape of the original
signal, then include a screenshot of the scope output in your lab report. Repeat the above steps to
recreate a sawtooth wave and report your observations.
Post-Subproject Questions:
Q1. Does changing the max step size in the configuration parameters have any effect on the
way the model runs?
Q2. In part A, does the change in simulation time have any effect on the model output?
Q3. In part C, what is the relation of the sample time to the signal frequency to get a
reasonably good representation of the frequency domain components?
Q4. In part D, change the phase and magnitude of each harmonic. Which is more important:
the phase of a harmonic or the magnitude?
For each of the above parts show the output result. To answer above questions, show the examples
that you tested and the output that you received for each. Report the results and answers in a
document.

Purchase answer to see full
attachment