📄 lhw_d_stbc_g2.mdl
字号:
BackgroundColor "lightBlue"
CopyFcn "set_param(gcbh,'LinkStatus','none')"
PreSaveFcn "try, set_param(gcb,'FunctionName','D_Decoder'),"
" end"
OpenFcn "sfunctionwizard(gcbh)"
FontSize 10
FunctionName "D_Decoder"
SFunctionModules "D_Decoder_wrapper "
WizardData "DataTag1"
MaskType "S-Function Builder"
MaskInitialization "val = [[.9 0.75 0.75 1 1 .9 .9 1]',[1 1 0.75 0"
".75 .9 .9 1 .9]'];try , sys = get_param(gcb,'SfunBuilderFcnName');if isempty("
"sys), sys = get_param(gcb,'FunctionName'); end,catch, sys = get_param(gcb,'Fu"
"nctionName'); end"
MaskDisplay "plot(val(:,1),val(:,2)),disp(sys)port_label('in"
"put',1,'R1')port_label('input',2,'R2')port_label('output',1,'y')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "normalized"
}
Block {
BlockType Display
Name "Display"
Ports [1]
Position [505, 469, 590, 531]
FontSize 10
Decimation "1"
}
Block {
BlockType Reference
Name "Error Rate\nCalculation"
Ports [2, 1]
Position [378, 425, 462, 480]
Orientation "down"
NamePlacement "alternate"
FontSize 10
SourceBlock "commsink2/Error Rate\nCalculation"
SourceType "Error Rate Calculation"
N "0"
st_delay "0"
cp_mode "Entire frame"
subframe "[]"
PMode "Port"
WsName "ErrorVec"
RsMode2 off
stop on
numErr "50"
maxBits "1e5"
}
Block {
BlockType FrameConversion
Name "Frame Conversion"
Position [705, 285, 760, 325]
Orientation "left"
FontSize 10
OutFrame "Frame based"
}
Block {
BlockType Reference
Name "Integer to Bit\nConverter"
Ports [1, 1]
Position [175, 286, 225, 324]
FontSize 10
SourceBlock "commutil2/Integer to Bit\nConverter"
SourceType "Integer to Bit Converter"
nbits "1"
}
Block {
BlockType Reference
Name "Integer to Bit\nConverter1"
Ports [1, 1]
Position [605, 286, 655, 324]
Orientation "left"
FontSize 10
SourceBlock "commutil2/Integer to Bit\nConverter"
SourceType "Integer to Bit Converter"
nbits "1"
}
Block {
BlockType "S-Function"
Name "Pad 00"
Ports [1, 1]
Position [85, 62, 120, 98]
CopyFcn "set_param(gcbh,'LinkStatus','none')"
OpenFcn "sfunctionwizard(gcbh)"
FontSize 10
FunctionName "Pading11"
SFunctionModules "Pading11_wrapper "
WizardData "DataTag2"
MaskType "S-Function Builder"
MaskInitialization "val = [[.9 0.75 0.75 1 1 .9 .9 1]',[1 1 0.75 0"
".75 .9 .9 1 .9]'];try , sys = get_param(gcb,'SfunBuilderFcnName');if isempty("
"sys), sys = get_param(gcb,'FunctionName'); end,catch, sys = get_param(gcb,'Fu"
"nctionName'); end"
MaskDisplay "plot(val(:,1),val(:,2)),disp(sys)port_label('in"
"put',1,'u0')port_label('output',1,'y0')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "normalized"
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [360, 56, 395, 89]
Inputs "**"
Multiplication "Matrix(*)"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [360, 161, 395, 194]
Inputs "**"
Multiplication "Matrix(*)"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "R1"
Ports [2, 1]
Position [655, 67, 685, 98]
SourceBlock "simulink/Math\nOperations/Dot Product"
SourceType "Dot Product"
InputSameDT on
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "R2"
Ports [2, 1]
Position [655, 172, 685, 203]
SourceBlock "simulink/Math\nOperations/Dot Product"
SourceType "Dot Product"
InputSameDT on
OutputDataTypeScalingMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^-10"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "Random Integer\nGenerator"
Ports [0, 1]
Position [15, 65, 65, 95]
FontSize 10
SourceBlock "commrandsrc2/Random Integer\nGenerator"
SourceType "Random Integer Generator"
ShowPortLabels on
mul "2"
seed "36887"
Ts "1e-5"
frameBased on
sampPerFrame "2"
orient off
}
Block {
BlockType "S-Function"
Name "S-Function Builder"
Ports [2, 2]
Position [381, 340, 459, 400]
Orientation "down"
NamePlacement "alternate"
CopyFcn "set_param(gcbh,'LinkStatus','none')"
PreSaveFcn "try, set_param(gcb,'FunctionName','To_Frame'), "
"end"
InitFcn "try, set_param(gcb,'FunctionName','To_Frame'), "
"end,"
OpenFcn "sfunctionwizard(gcbh)"
FontSize 10
FunctionName "To_Frame"
SFunctionModules "To_Frame_wrapper "
WizardData "DataTag3"
MaskType "S-Function Builder"
MaskInitialization "val = [[.9 0.75 0.75 1 1 .9 .9 1]',[1 1 0.75 0"
".75 .9 .9 1 .9]'];try , sys = get_param(gcb,'SfunBuilderFcnName');if isempty("
"sys), sys = get_param(gcb,'FunctionName'); end,catch, sys = get_param(gcb,'Fu"
"nctionName'); end"
MaskDisplay "plot(val(:,1),val(:,2)),disp(sys)port_label('in"
"put',1,'x1')port_label('input',2,'x2')port_label('output',1,'y1')port_label('"
"output',2,'y2')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "normalized"
}
Block {
BlockType Math
Name "T"
Ports [1, 1]
Position [255, 56, 275, 74]
Operator "transpose"
}
Block {
BlockType Math
Name "T1"
Ports [1, 1]
Position [255, 86, 275, 104]
Operator "transpose"
}
Block {
BlockType Reference
Name "Tapped Delay"
Ports [1, 1]
Position [545, 41, 580, 69]
SourceBlock "simulink/Discrete/Tapped Delay"
SourceType "Tapped Delay Line"
vinit "0.0"
samptime "-1"
NumDelays "1"
DelayOrder "Oldest"
includeCurrent off
}
Block {
BlockType Reference
Name "Tapped Delay1"
Ports [1, 1]
Position [555, 146, 590, 174]
SourceBlock "simulink/Discrete/Tapped Delay"
SourceType "Tapped Delay Line"
vinit "0.0"
samptime "-1"
NumDelays "1"
DelayOrder "Oldest"
includeCurrent off
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [520, 555, 580, 585]
VariableName "ErrorVec"
MaxDataPoints "1"
SampleTime "-1"
SaveFormat "Array"
}
Line {
SrcBlock "Random Integer\nGenerator"
SrcPort 1
DstBlock "Pad 00"
DstPort 1
}
Line {
SrcBlock "D-STBC G2"
SrcPort 1
DstBlock "T"
DstPort 1
}
Line {
SrcBlock "D-STBC G2"
SrcPort 2
DstBlock "T1"
DstPort 1
}
Line {
SrcBlock "T"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "Channel Coefficients"
SrcPort 1
Points [65, 0]
Branch {
DstBlock "Product1"
DstPort 2
}
Branch {
Points [0, -105]
DstBlock "Product"
DstPort 2
}
}
Line {
SrcBlock "T1"
SrcPort 1
Points [10, 0; 0, 75]
DstBlock "Product1"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "AWGN\nChannel"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "AWGN\nChannel1"
DstPort 1
}
Line {
SrcBlock "R1"
SrcPort 1
Points [20, 0; 0, 30]
DstBlock "D-STBC decoder"
DstPort 1
}
Line {
SrcBlock "Integer to Bit\nConverter"
SrcPort 1
DstBlock "Buffer"
DstPort 1
}
Line {
SrcBlock "Integer to Bit\nConverter1"
SrcPort 1
DstBlock "Buffer1"
DstPort 1
}
Line {
SrcBlock "Error Rate\nCalculation"
SrcPort 1
Points [0, 15]
Branch {
DstBlock "Display"
DstPort 1
}
Branch {
Points [0, 70]
DstBlock "To Workspace"
DstPort 1
}
}
Line {
SrcBlock "Frame Conversion"
SrcPort 1
DstBlock "Integer to Bit\nConverter1"
DstPort 1
}
Line {
SrcBlock "Pad 00"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "D-STBC G2"
DstPort 1
}
Branch {
Points [0, 225]
DstBlock "Integer to Bit\nConverter"
DstPort 1
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -