📄 qam_simlk.mdl
字号:
stop off
numErr "100"
maxBits "1e6"
}
Block {
BlockType Concatenate
Name "Matrix\nConcatenation"
Ports [2, 1]
Position [355, 244, 410, 286]
Mode "Horizontal matrix concatenation"
}
Block {
BlockType Reference
Name "Raised Cosine\nReceive Filter"
Ports [1, 1]
Position [455, 63, 535, 107]
DialogController "dspDDGCreate"
DialogControllerArgs "DataTag0"
SourceBlock "commfilt2/Raised Cosine\nReceive Filter"
SourceType "Raised Cosine Receive Filter"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
filtType "Square root"
N "8"
D "3"
R "0.3"
sampMode "Frame-based"
rateMode "None"
downFactor "8"
downOffset "0"
checkGain "Normalized"
filterGain "1"
checkCoeff off
variableName "rcRxFilt"
launchFVT off
}
Block {
BlockType Reference
Name "Raised Cosine\nTransmit Filter"
Ports [1, 1]
Position [230, 63, 310, 107]
DialogController "dspDDGCreate"
DialogControllerArgs "DataTag1"
SourceBlock "commfilt2/Raised Cosine\nTransmit Filter"
SourceType "Raised Cosine Transmit Filter"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
filtType "Square root"
D "3"
R "0.3"
sampMode "Frame-based"
N "8"
checkGain "Normalized"
filterGain "1"
checkCoeff off
variableName "rcTxFilt"
launchFVT off
}
Block {
BlockType Reference
Name "Random Integer\nGenerator"
Ports [0, 1]
Position [15, 63, 95, 107]
SourceBlock "commrandsrc2/Random Integer\nGenerator"
SourceType "Random Integer Generator"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
mul "M"
seed "37"
Ts "1/1000000"
frameBased on
sampPerFrame "100"
orient off
outDataType "double"
}
Block {
BlockType Reference
Name "Rectangular QAM\nDemodulator\nBaseband"
Ports [1, 1]
Position [640, 59, 715, 111]
SourceBlock "commdigbbndam3/Rectangular QAM\nDemodulator\nBa"
"seband"
SourceType "Rectangular QAM Demodulator Baseband"
M "M"
OutType "Integer"
Dec "Binary"
Mapping "[0:15]"
PowType "Min. distance between symbols"
MinDist "2"
AvgPow "1"
PeakPow "1"
Ph "0"
outDtype1 "double"
outDtype2 "double"
}
Block {
BlockType Reference
Name "Rectangular QAM\nModulator\nBaseband"
Ports [1, 1]
Position [130, 59, 205, 111]
SourceBlock "commdigbbndam3/Rectangular QAM\nModulator\nBase"
"band"
SourceType "Rectangular QAM Modulator Baseband"
M "M"
InType "Integer"
Enc "Binary"
Mapping "[0:15]"
PowType "Min. distance between symbols"
MinDist "2"
AvgPow "1"
PeakPow "1"
Ph "0"
outDtype "double"
outWordLen "16"
outUDDataType "sfix(16)"
outFracLenMode "Best precision"
outFracLen "15"
}
Block {
BlockType SubSystem
Name "Simulation Parameters"
Ports []
Position [104, 246, 228, 294]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
MaskPromptString "Eb/No (dB)|Modulation Order"
MaskStyleString "edit,edit"
MaskTunableValueString "on,on"
MaskCallbackString "qam_setup;|qam_setup;"
MaskEnableString "on,on"
MaskVisibilityString "on,on"
MaskToolTipString "on,on"
MaskVarAliasString ","
MaskVariables "SNR=@1;M=@2;"
MaskInitialization "qam_setup;"
MaskDisplay "disp(['Eb/No ' num2str(SNR,'%2.1f') 'dB' \nsp"
"rintf('\\n') 'Modulation Order ' num2str(M,'%2.0f')])\n"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "12|16"
MaskTabNameString ","
System {
Name "Simulation Parameters"
Location [142, 249, 291, 321]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
}
}
Block {
BlockType Reference
Name "Spectrum\nScope"
Ports [1]
Position [480, 240, 515, 290]
AttributesFormatString "\\n"
DialogController "dspdialog.SpectrumScope"
DialogControllerArgs "DataTag2"
SourceBlock "dspsnks4/Spectrum\nScope"
SourceType "Spectrum Scope"
ShowPortLabels off
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
ScopeProperties off
Domain "Frequency"
HorizSpan "1"
UseBuffer on
BufferSize "512"
Overlap "256"
inpFftLenInherit off
FFTlength "128"
numAvg "4"
DisplayProperties on
AxisGrid on
Memory off
FrameNumber off
AxisLegend off
AxisZoom off
OpenScopeAtSimStart on
OpenScopeImmediately off
FigPos "[30 50 260 260]"
AxisProperties off
XUnits "Hertz"
XRange "[-Fs/2...Fs/2]"
InheritXIncr on
XIncr "1"
XLabel "Samples"
YUnits "dB"
YMin "-60"
YMax "20"
YLabel "Magnitude, dB"
LineProperties off
LineColors "b|r"
wintypeSpecScope "Hann"
RsSpecScope "50"
betaSpecScope "5"
winsampSpecScope "Periodic"
}
Line {
SrcBlock "Random Integer\nGenerator"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "Rectangular QAM\nModulator\nBaseband"
DstPort 1
}
Branch {
Points [0, -55; 615, 0]
DstBlock "Error Rate\nCalculation"
DstPort 1
}
}
Line {
SrcBlock "Error Rate\nCalculation"
SrcPort 1
DstBlock "Display"
DstPort 1
}
Line {
SrcBlock "Rectangular QAM\nModulator\nBaseband"
SrcPort 1
DstBlock "Raised Cosine\nTransmit Filter"
DstPort 1
}
Line {
Labels [0, 0]
SrcBlock "Downsample"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "Rectangular QAM\nDemodulator\nBaseband"
DstPort 1
}
Branch {
Points [0, 80]
DstBlock "Discrete-Time\nScatter Plot\nScope"
DstPort 1
}
}
Line {
SrcBlock "Rectangular QAM\nDemodulator\nBaseband"
SrcPort 1
DstBlock "Error Rate\nCalculation"
DstPort 2
}
Line {
SrcBlock "Raised Cosine\nTransmit Filter"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
DstBlock "AWGN\nChannel"
DstPort 1
}
Branch {
Points [0, 190]
DstBlock "Matrix\nConcatenation"
DstPort 2
}
}
Line {
SrcBlock "AWGN\nChannel"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
DstBlock "Raised Cosine\nReceive Filter"
DstPort 1
}
Branch {
Points [0, 115; -105, 0; 0, 55]
DstBlock "Matrix\nConcatenation"
DstPort 1
}
}
Line {
SrcBlock "Raised Cosine\nReceive Filter"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "Downsample"
DstPort 1
}
Branch {
Points [0, 185]
DstBlock "Discrete-Time\nEye Diagram\nScope"
DstPort 1
}
}
Line {
SrcBlock "Matrix\nConcatenation"
SrcPort 1
DstBlock "Spectrum\nScope"
DstPort 1
}
Annotation {
Name "SER"
Position [944, 50]
UseDisplayTextAsClickCallback off
}
Annotation {
Name "Total Errors"
Position [959, 72]
UseDisplayTextAsClickCallback off
}
Annotation {
Name "Total Symbols"
Position [967, 94]
UseDisplayTextAsClickCallback off
}
Annotation {
Name "Baseband Simulation of QAM\nunder AWGN Channel"
Position [165, 197]
UseDisplayTextAsClickCallback off
FontSize 12
FontWeight "bold"
}
}
}
MatData {
NumRecords 3
DataRecord {
Tag DataTag2
Data " %)30 . , 8 ( ! % "
"\" 0 0 "
}
DataRecord {
Tag DataTag1
Data " %)30 . P 8 ( 0 % "
"\" $ \" 0 . 2 8 ( ! % \" $ "
" 4 0 0 % %)A:7-E9$-O<VEN949I;'1E<E1X X ! !@ @"
" $ 4 ( 0 H ! ! * 8V]M;61I86QO9P "
" "
}
DataRecord {
Tag DataTag0
Data " %)30 . P 8 ( 0 % "
"\" $ \" 0 . 2 8 ( ! % \" $ "
" 4 0 0 % %)A:7-E9$-O<VEN949I;'1E<E)X X ! !@ @"
" $ 4 ( 0 H ! ! * 8V]M;61I86QO9P "
" "
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -