EGR324L: Linear Systems and Signals Lab Lab 5: Fourier Synthesizer-Simulation using SIMULINK Objective There are two parts in this experiment. The first part is an introductory session, in which you...

1 answer below »
I have this lab the need to done using Matlab. I want all the files from matlabs please read the instruction.


EGR324L: Linear Systems and Signals Lab Lab 5: Fourier Synthesizer-Simulation using SIMULINK Objective There are two parts in this experiment. The first part is an introductory session, in which you will be introduced to an industry standard simulation program known as SIMULINK and you will learn the basic procedures to simulate a simple dynamic system including a signal generator and a scope. The purpose in the second part is to demonstrate how a periodic waveform can be generated by summing up sinusoids of multiple frequencies. You will use SIMULINK to simulate this waveform synthesis process. PART I: Introduction to SIMULINK Background SIMULINK is a program for simulating signals and dynamic systems. As an extension to MATLAB, SIMULINK adds many features specific to simulation of dynamic systems while retaining all of MATLAB's general purpose functionality. SIMULINK has two phases of use: model definition and model analysis. A typical session starts by either defining a model or recalling a previously defined model, and then proceeds to analysis of that model. To facilitate the model definition, SIMULINK possesses a large class of windows called block diagram windows. In these windows, models are created and edited principally by mouse driven commands. Part of mastering SIMULINK is to become familiar with manipulation of model components in these windows. After you define a model, you can analyze it either by choosing options from the SIMULINK menus or by entering commands in MATLAB's command window. The progress of an ongoing simulation can be viewed while it is running, and the final results can be made available in the MATLAB workspace when the simulation is completed. Procedure 1. Enter the command simulink at the MATLAB prompt to open the main block library. 2. Enter the command blocklib at the MATLAB prompt to open the library for the most commonly used blocks. 3. Click on the SIMULINK or blocklib window, and select New... from the File menu on its menu bar to open a new empty window in which you can construct a system model. The new window is labeled "Untitle"; you can rename it when you save it. 4. Drag the blocks "Signal Gen" and "Scope" into the active window. The angle bracket (>) pointing out of the Signal Generator's block's icon represents its output port, and the angle bracket pointing into the Scope icon represents its input port. 5. After the blocks have been placed, draw a line to connect the block "Signal Gen" to the block "Scope". To connect these two blocks, use the left mouse button to click on either the output or input port of one block, drag to the other block's input or output port to draw a connected line, and then release the left mouse button. 6. Open the Signal Generator block and Scope block by double-clicking on their icons. 7. Pull down the Simulation menu and choose Parameters. Select the text box for Maximum Step Size parameter, change the value to 0.01. 8. Start the simulation by choosing Start from the Simulation menu. 9. Adjust the parameters in the Signal Generator block and Scope block, and observe their effects on the waveform displaying in the scope window. Try several times. 10. Stop the simulation by selecting Stop from Simulation menu. 11. Now save the system to disk as a MATLAB M-file by selecting Save from the File menu. The M-file contains all the commands necessary to describe the model, so that it can be simulated or redrawn on the screen for further editing. Note: lab report is not required for this section. Part II: Fourier Synthesizer Background From Fourier representation theory, a periodic signal f(t) can always be expanded in the trigonometric series: where the period is 2l. Note in particular, that if f(t) is an even function, then bn = 0, and that if f(t) is an odd function, then an = 0. A periodic wave can be simulated by summing the output of several sine wave generators where each generator is generating one harmonic of the periodic wave. The magnitude and phase of each generator must be separately controlled. Such a system model is called a Fourier Synthesizer and will be constructed to simulate several periodic waves in this experiment. The synthesizer generates the fundamental through the nth harmonic with separate magnitude and phase controls on each. The sum of all the harmonics is available as an output. The Sine Wave block in the SIMULINK provides a time varying sinusoids. The amplitude, frequency, and the phase of the signal are determined by the selected parameters. We will use a Sine Wave block as a harmonic generator in the Fourier Synthesizer. Note that the parameters in the Sine Wave block can be set to constants or variables or any valid MATLAB mathematical expression involving constants or variables. Any variables on which a parameter is dependent must be defined in the workspace when a simulation is started, or SIMULINK will signal an error for the block. The Sum block in the SIMULINK adds the value of each input to produce a scalar output. The list of sign parameters may be represented with a constant or a combination of the symbols (+, -) . A combination of pluses and minuses describes the polarity of each individual port, where the number of ports is equal to the number of symbols used. The length of the string is used to determine the number of ports drawn. All the characters other than plus sign are interpreted as the minus signs, including spaces. It is important not to leave spaces between plus and minus signs in the parameter string, or they will cause unwanted negative polarity input ports to appear. This block will serve as a crucial part in the synthesizer superposing all the input harmonics to form the desired periodic waveform. The Scope block in the SIMULINK will be used to display both the input harmonics and the final output waveform. The Power Spectral Density Analyzer Block will be used to analyze the spectrum of the input waveform. Prelab 1. Write the Fourier Series of a square wave with odd symmetry, a peak value of 0.7 volts, an average value of zero and a fundamental frequency of 440 Hz. Write the series in sine form up to the 9th harmonic. Estimate roughly how many harmonics you'll need to add to have a reasonably accurate approximation to the waveform. 2. Write the Fourier series of a triangular wave with even symmetry, a peak value of 1.0 volts, an average value of zero and a fundamental frequency of 440 Hz. Write the series in sine form up to the 9th harmonic. 3. Draw a diagram of the Fourier Synthesizer using the blocks available in SIMULINK, i.e,. Sine Wave, Sum, and Scope, where the Scope block is used for displaying the synthesized periodic wave. Procedure 1. Use SIMULINK blocks, i.e. Sine Wave, Sum, Scope, and Averaging Spectrum analyzer, to construct a Fourier Synthesizer model for the periodic square wave in Prelab 1; start with contains two inputs: one is the fundamental, and the other is the 1st harmonic. Based on your calculations in the Prelab 1, set the magnitude, phase, and frequency for these two inputs to the synthesizer, i.e., set the parameters in the Sine blocks which are used to generate the input signals of the synthesizer. Before you add these inputs to the synthesizer, observe the signal on the Scope. Make sure that the display is consistent with the parameters you set. Start the simulation and observe the output waveform in the scope window and its spectrum in the window of Averaging Spectrum analyzer. Note: the path for the Averaging Spectrum analyzer Block is as follows: blocklib→Simulink→Extras→Filters→DEMO. 2. Add 2nd, 3rd ... and 9th harmonics to the system, one at each time. To do this, you first need to add a "+" in the parameter field of the Sum block, then insert another Sine Wave generator into the system; of course, you need to set the proper parameters for the Sine Wave, based on your prelab calculation. Again, you need to observe the individual harmonics using Scope. Observe the change of the output waveform in the Scope window when the high order harmonics are added to the system. Generate a square wave with the specification in Prelab 1, directively from the Wave Generator Block. Compare your simulated result with this square wave by superposing the two waveforms. Are they consistent? Can you find out how many harmonics you need to add to achieve this accuracy? Is your discovery consistent with your estimate in the Prelab? Is it consistent with the spectrum you observed? 3. Print the simulated square wave for your report. Do not measure the period of the simulated wave, just assume that it is the same as the square wave in the prelab. 4. Save this working model to disk as a MATLAB M-file. The model will be useful for later experiments. 5. Change the phase and magnitude of each harmonic and note that as far as wave shape is concerned the phase of a harmonic is much more important than the magnitude. Try this step for a few times, print out a waveform which can support your conclusion based on your observation. 6. If you have a periodic wave and all of the even harmonics are removed, then the Fourier Series of the resulting wave will have only odd harmonics and will have half-wave odd symmetry. Sketch the output wave from (6) and then on the same axes with the same scales sketch what you would guess t he output would look like if the even harmonics were removed. Remove the even harmonics and observe the output. 7. Repeat above steps for the triangular wave in Prelab 2. Report Turn in the SIMULINK models and all graphical plots. Discuss the results of your experiment, and the questions and confusions you have experienced about this experiment.
Answered Same DayOct 19, 2021

Answer To: EGR324L: Linear Systems and Signals Lab Lab 5: Fourier Synthesizer-Simulation using SIMULINK...

Kshitij answered on Oct 24 2021
147 Votes
Section1/signal_generation.slx
[Content_Types].xml

_rels/.rels

metadata/coreProperties.xml
model 2020-10-21T14:55:25Z RajmohanV RajmohanV 2020-10-21T17:38:32Z 1.1 R2020a
metadata/mwcoreProperties.xml
application/vnd.mathworks.simulink.model Simulink Model R2020a
metadata/mwcorePropertiesExtension.xml
9.8.0.1319068 4f5dcd87-34be-4c9f-a23d-2c39158bf592
metadata/mwcorePropertiesReleaseInfo.xml

9.8.0.1323502
R2020a

Feb 25 2020
3410093040
metadata/thumbnail.png
simulink/ScheduleCore.xml


HighNumberLast

true



false
Default
-2147483648


true

false
1
Cont
40

Cont
255
true

0

0





simulink/ScheduleEditor.xml




40

#000000
true
0
Cont

Cont
base


Cont



Default





0,0
0,0,0,0

Cont
base

0,0

Cont
graph.Graph



Default
graph.Graph

simulink/_rels/blockdiagram.xml.rels

simulink/_rels/configSetInfo.xml.rels

simulink/bddefaults.xml


landscape
auto
usletter
inches
[0.500000, 0.500000, 0.500000, 0.500000]
1
off
on
200
white
100
off
off


black
white
off
bottom
Helvetica
10
normal
normal
on
on
0
off


left
top
black
white
off
Helvetica
10
normal
normal
model
off
note_annotation
off
off
off


Helvetica
9
normal
normal










Simulink.scopes.TimeScopeBlockCfg


sine
Use simulation time
1
1
Hertz
on


simulink/blockdiagram.xml


windows-1252
on
Normal
0.035000
on
off
UseLocalSettings
AllNumericTypes
UseLocalSettings
Overwrite
Run 1
120
win64
on

UpdateHistoryNever
%
%
525222068
1.%


off
off
disabled
off
off
off
off
AliasTypeOnly
on
on
off
off
off
on
off
off
on
on
on
off
off
on
on
on
off
off
off
off
on
on
off
off
off
on


normal
automated
topmodel
normal
normal
normal
software-in-the-loop (sil)
5
1
10
10
0
off
1
none
off
MATLABWorkspace
accel.tlc
accel_default_tmf
make_rtw
off

$bdroot
0U

$bdroot


[]




off
on
manual
normal
1
any
1000
auto
0
0
rising
0
off
off
off
off
off
on
off
on
on


off
off
on



Ensure deterministic transfer (maximum delay)
Ensure data integrity only
Ensure deterministic transfer (minimum delay)
None

off



simulink/configSet0.xml


[]



[]

[]
0.0
10.0
auto
on
auto
auto
5
auto
10*128*eps
1000
4
1
auto
auto
1
1e-3
off
off
VariableStepAuto
VariableStepAuto
auto
DisableAll
UseLocalSettings
Nonadaptive
TrustRegion
off
off
Fast
off
off
Unconstrained
Whenever possible
[]
off
off
ode3


[]

[]
1
[t, u]
xFinal
xInitial
off
1000
off
off
off
off
Dataset
Dataset
on
off
on
on
off
on
off
streamout
on
on
xout
tout
yout
logsout
dsmout
RefineOutputTimes
[]
out
1
off
timeseries
out.mat
[-inf, inf]



BooleansAsBitfields
PassReuseOutputArgsAs
PassReuseOutputArgsThreshold
ZeroExternalMemoryAtStartup
ZeroInternalMemoryAtStartup
OptimizeModelRefInitCode
NoFixptDivByZeroProtection
UseSpecifiedMinMax
EfficientTunableParamExpr


[]
on
on
on
Tunable
off
off
off
double
off
off
on
on
off
off
on
off

on
off
uint_T
Same as modeled
on
64
Structure reference
12
128
on
5
off
off
Native Integer
on
on
off
off
off
on
auto
Inherit from target
on
off
off
off
on
on
off
off
level2
Balanced
on
off
off
GradualUnderflow
off



UseOnlyExistingSharedCode


[]
error
none
none
none
error
none
UseLocalSettings
UseLocalSettings
UseLocalSettings
warning
warning
warning
warning
on
Simplified
error
off
off
UseLocalSettings
warning
warning
none
error
warning
warning
none
warning
error
error
error
none
warning
none
warning
none
warning
warning
error
error
none
warning
warning
none
none
none
none
none
none
error
none
warning
warning
warning
error
none
error
none
warning
warning
UseLocalSettings
on
off
none
error
none
none
warning
warning
warning
error
none
warning
error
none
warning
none
warning
ErrorLevel1
WarnAndRepair
none
warning
warning
error
error
none
warning
error
warning
error
warning
warning
warning
warning
error
warning
warning
warning
warning
warning
all
warning
on
warning
warning
off

none
off
error


[]

[]
8
16
32
32
64
32
64
64
64
64
Char
Float
Zero
LittleEndian
64
on
off
Intel->x86-64 (Windows64)
8
16
32
32
64
32
64
32
32
32
Char
None
on
off
Undefined
Unspecified
32
32
32
Specified
off
on
on
on
EmbeddedCoderHSP


[]

[]
IfOutOfDateOrStructuralChange
on
error
off
on
None
Multi
Infer from blocks in model

on
off
on
off


[]

[]




[]






on
on
on
on
on
off
sf_incremental_build
off
on
50
on
on
65536
[]
NotSpecified
FilterOut



IncludeHyperlinkInReport
GenerateTraceInfo
GenerateTraceReport
GenerateTraceReportSl
GenerateTraceReportSf
GenerateTraceReportEml
PortableWordSizes
GenerateWebview
GenerateCodeMetricsReport
GenerateCodeReplacementReport
GenerateMissedCodeReplacementReport
GenerateErtSFunction
CreateSILPILBlock
CodeExecutionProfiling
CodeProfilingSaveOptions
CodeProfilingInstrumentation


grt.tlc
None
off
off

off
make_rtw
on
off

grt_default_tmf

off
on
off
[]
off
off
off
off
on
off











Automatically locate an installed toolchain
Faster Builds
[]
off
off
off
None
off
executionProfile
SummaryOnly
off
off
C
off
off
off
off
off
off
off
off
off
off
off
[]

Off
1024



IgnoreCustomStorageClasses
IgnoreTestpoints
BlockCommentType
InsertBlockDesc
InsertPolySpaceComments
SFDataObjDesc
MATLABFcnDesc
SimulinkDataObjDesc
DefineNamingRule
SignalNamingRule
ParamNamingRule
InternalIdentifier
InlinedPrmAccess
CustomSymbolStr
CustomSymbolStrGlobalVar
CustomSymbolStrType
CustomSymbolStrField
CustomSymbolStrFcn
CustomSymbolStrModelFcn
CustomSymbolStrFcnArg
CustomSymbolStrBlkIO
CustomSymbolStrTmpVar
CustomSymbolStrMacro
CustomSymbolStrUtil
CustomSymbolStrEmxType
CustomSymbolStrEmxFcn
CustomUserTokenString
ReqsInCode


[]

off
on
Auto
on
off
31
off
off
off
off
off
off
off
1
8
$R$N$M
$N$R$M_T
$N$M
$R$N$M$F
$R$N
rt$I$N$M
rtb_$N$M
$N$M
$R$N$M
$N$C
emxArray_$M$N
emx$M$N


None

None

None

off
off
on
BlockPathComment
off
off
off

Shortened
Literals
off
off
[]
error



IncludeMdlTerminateFcn
SuppressErrorStatus
ERTCustomFileBanners
GenerateSampleERTMain
ExistingSharedCode
GenerateTestInterfaces
ModelStepFunctionPrototypeControlCompliant
GenerateAllocFcn
PurelyIntegerCode
SupportComplex
SupportAbsoluteTime
SupportContinuousTime
SupportNonInlinedSFcns
RemoveDisableFunc
RemoveResetFunc
PreserveStateflowLocalDataDimensions


[]
ansi_tfl_table_tmw.mat


NOT IN USE
C99 (ISO)
None
Auto
System defined
2048
256
on
off

off
off
on
on
on
on
on
on
off
off
off
Auto
off
on
rt_
on
off
Nonreusable function
off
on
on
on
on
off
off
off
Nominal
Nominal
Simulink.SoftwareTarget.GRTCustomization
off
on
off
off
off
off
on
on
[]
[]
1,2,3,4,...
Size,Breakpoints,Table
Size,Breakpoints,Table
Column-major
error
$R$E
$R$E
$R_data
off
off
off
off
1000000
0
ext_comm

Level1
off
off
off
off
off
Error




[]
Simulink Coverage Configuration Component
[]
Simulink Coverage
off
EntireSystem
on
off
/
covdata

dwe


off
off
on
on
off
off
covCumulativeData
off
on
slcov_output/$ModelName$
$ModelName$_cvdata
on
on
off

on
on
1e-05
0.01
off
0
0
Masking


Configuration
Solver
[ 0, 0, 0, 0 ]


simulink/configSetInfo.xml

Configuration
simulink/graphicalInterface.xml

0
0

0
0
0
0
0
0
0
Unset
0
0
0
0
0
1
simulink/modelDictionary.xml




simulink/plugins/AnimationPlugin.xml

on
simulink/plugins/DiagnosticSuppressor.xml

on
simulink/plugins/LogicAnalyzerPlugin.xml

on
simulink/plugins/NotesPlugin.xml

on
simulink/plugins/SLCCPlugin.xml

on
simulink/plugins/WebScopes_FoundationPlugin.xml

on
simulink/systems/system_root.xml

[-8, -8, 1374, 736]
on
off
Deduce
simulink-default.rpt
2
Simulink

[1]
[780, 204, 825, 256]
2
Simulink.scopes.TimeScopeBlockCfg('CurrentConfiguration', extmgr.ConfigurationSet(extmgr.Configuration('Core','General UI',true),extmgr.Configuration('Core','Source UI',true),extmgr.Configuration('Sources','WiredSimulink',true),extmgr.Configuration('Visuals','Time Domain',true,'SerializedDisplays',{struct('MinYLimReal','-1.24563','MaxYLimReal','1.24904','YLabelReal','','MinYLimMag','0.00000','MaxYLimMag','1.24904','LegendVisibility','off','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.831372549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLines',1,'LineNames',{{'Signal Generator'}},'ShowContent',true,'Placement',1)},'DisplayPropertyDefaults',struct('MinYLimReal','-1.24563','MaxYLimReal','1.24904','YLabelReal','','MinYLimMag','0.00000','MaxYLimMag','1.24904','LegendVisibility','off','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;1 1 0.0666666666666667;0.717647058823529 0.274509803921569 1;0.392156862745098 0.831372549019608 0.0745098039215686;0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863])),extmgr.Configuration('Tools','Plot Navigation',true),extmgr.Configuration('Tools','Measurements',true,'Version','2020a')),'Version','2020a','VisibleAtModelOpen','on')
1
off


[0, 1]
[615, 195, 660, 265]
1
rad/sec


1
1#out:1
2#in:1

simulink/windowsInfo.xml



1
[-8.0, -8.0, 1382.0, 744.0]

1
Left
50
50
9
On


1


1
1
SimulinkTopLevel
0
[1266.0, 502.0]
1.0
[0.0, 0.0]
[0.0, 0.0, 1266.0, 502.0]


GLUE2:PropertyInspector
Property Inspector
1


0
Right
640
480
On

AAAA/wAAAAD9AAAAAgAAAAAAAAC9AAAB+PwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAAAAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAAP////8AAABjAP///wAAAAEAAAAAAAAAAPwCAAAAAfsAAABUAEcATABVAEUAMgA6AFAAcgBvAHAAZQByAHQAeQBJAG4AcwBwAGUAYwB0AG8AcgAvAFAAcgBvAHAAZQByAHQAeQAgAEkAbgBzAHAAZQBjAHQAbwByAAAAAAD/////AAABrAD///8AAAUYAAACMwAAAAEAAAACAAAAAQAAAAL8AAAAAwAAAAAAAAABAAAANgBjAG8AbABsAGEAcABzAGkAYgBsAGUAUABhAG4AZQBsAFQAbwBvAGwAQgBhAHIATABlAGYAdAMAAAAA/////wAAAAAAAAAAAAAAAQAAAAEAAAA4AGMAbwBsAGwAYQBwAHMAaQBiAGwAZQBQAGEAbgBlAGwAVABvAG8AbABCAGEAcgBSAGkAZwBoAHQDAAAAAP////8AAAAAAAAAAAAAAAMAAAABAAAAOgBjAG8AbABsAGEAcABzAGkAYgBsAGUAUABhAG4AZQBsAFQAbwBvAGwAQgBhAHIAQgBvAHQAdABvAG0AAAAAAP////8AAAAAAAAAAA==

0b82776b-3568-4091-8b56-551a033ff4d9

7658acbb-1288-475b-89d6-388dfee8beb7

Section_2/Solution_1.mclc
clear all
close all
%% Prelab_1
fs = 440;
ts = 1/fs
t = 0 : ts : 10;
%%
figure,plot(t,sin(t))
title 'Sin wave'
y = sin(t) + sin(3*t)/3 + sin(5*t)/5 + sin(7*t)/7 + sin(9*t)/9;
figure,plot(t,y)
title 'Square wave based on hormonic distortions from Sin wave'
Section_2/Solution_1.slx
[Content_Types].xml

_rels/.rels

metadata/coreProperties.xml
model 2020-10-23T11:16:17Z RajmohanV RajmohanV 2020-10-23T12:15:35Z 1.4 R2020a
metadata/mwcoreProperties.xml
application/vnd.mathworks.simulink.model Simulink Model R2020a
metadata/mwcorePropertiesExtension.xml
9.8.0.1319068 4f5dcd87-34be-4c9f-a23d-2c39158bf592
metadata/mwcorePropertiesReleaseInfo.xml

9.8.0.1323502
R2020a

Feb 25 2020
3410093040
metadata/thumbnail.png
simulink/ScheduleCore.xml


HighNumberLast

true



...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here