📄 librnew.mdl
字号:
BlockType SubSystem
Name "Channel"
Ports [1, 1]
Position [155, 28, 235, 72]
ShowPortLabels off
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskType "AWGN channel, fixed parameter"
MaskDescription "Additive white Gaussian noise channel\nwith fix"
"ed mean and variance."
MaskHelp "This block adds white Gaussian noise to the inp"
"ut signal. The mean and the variance can be a scalar or vector with the same "
"length as the input signal."
MaskPromptString "Mean value:|Variance (std^2):|Initial Seed:"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVariables "m=@1;variance=@2;s=@3;"
MaskInitialization "[m,variance,s]=gwnoise(m,variance,s);\n"
MaskDisplay "plot(0,0,100,100);\ndisp('AWGN')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0|0.00010|12345"
MaskVariableAliases ",,"
System {
Name "Channel"
Location [43, 129, 305, 275]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [45, 10, 65, 30]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType SubSystem
Name "Gaussian noise\ngenerator"
Ports [0, 1]
Position [25, 48, 105, 92]
ShowPortLabels off
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskType "Gaussian noise generator"
MaskDescription "Generate Gaussian distributed noise with\ng"
"iven mean and variance value."
MaskHelp "When the mean value and seed are vectors, t"
"he output of this block is a vector. The length of the vector is the same as "
"the length of the mean value vector or the length of the seed. When the varia"
"nce entry is a vector, the variance is a diagonal matrix."
MaskPromptString "Mean value:|Variance (vector or matrix):|In"
"itial seed:"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVariables "m=@1;variance=@2;s=@3;"
MaskInitialization "[m,variance,s]=gwnoise(m,variance,s);[x,y]="
"srcsicon(3);"
MaskDisplay "plot(0,0,100,100,x,y);disp('Gaussian')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "m|variance|s"
MaskVariableAliases ",,"
System {
Name "Gaussian noise\ngenerator"
Location [22, 119, 370, 243]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Constant
Name "Constant"
Position [140, 20, 160, 40]
Value "m"
VectorParams1D on
}
Block {
BlockType StateSpace
Name "Matrix\nGain"
Position [140, 61, 165, 89]
A "[]"
B "[]"
C "[]"
D "K"
X0 "0"
AbsoluteTolerance "auto"
Realization "auto"
MaskType "Matrix Gain"
MaskDescription "Matrix Gain."
MaskHelp "Multiplies input vector by entered matr"
"ix to produce output vector (y=Au)."
MaskPromptString "Gain matrix:"
MaskStyleString "edit"
MaskTunableValueString "on"
MaskEnableString "on"
MaskVisibilityString "on"
MaskToolTipString "on"
MaskInitialization "K = @1;"
MaskDisplay "disp('K')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "variance"
}
Block {
BlockType RandomNumber
Name "Random\nNumber"
Position [35, 57, 80, 93]
Mean "0"
Variance "1"
Seed "s"
SampleTime "0"
VectorParams1D on
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [220, 60, 240, 80]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Outport
Name "out_1"
Position [285, 60, 305, 80]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [25, 0; 0, 35]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Matrix\nGain"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Random\nNumber"
SrcPort 1
DstBlock "Matrix\nGain"
DstPort 1
}
}
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [150, 55, 170, 75]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Outport
Name "out_1"
Position [200, 55, 220, 75]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "in_1"
SrcPort 1
Points [45, 0; 0, 40]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Gaussian noise\ngenerator"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "Error rate"
Ports [2]
Position [290, 25, 370, 65]
Orientation "down"
CopyFcn "sbiterr([],[],[],'CopyBlock')"
DeleteFcn "sbiterr([],[],[],'DeleteBlock')"
LoadFcn "sbiterr([],[],[],'LoadBlock')"
StartFcn "sbiterr([],[],[],'Start')"
StopFcn "sbiterr([],[],[],'Stop')"
NameChangeFcn "sbiterr([],[],[],'NameChange')"
ShowPortLabels off
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskType "Symbol/bit error counter"
MaskDescription "Use the input data from the 1st port as the ref"
"erence signal to detect the number of errors and error rate of the 2nd signal"
"."
MaskHelp "The signal from the first port must be a scalar"
". The second input port can be a vector with a delay to the first port signal"
". The comparison happens only at the sampling point."
MaskPromptString "Bit per symbol:|Number of digits on display:|De"
"lay between 1st port and 2nd port:|Sample time (sec):"
MaskStyleString "edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on"
MaskCallbackString "|||"
MaskEnableString "on,on,on,on"
MaskVisibilityString "on,on,on,on"
MaskToolTipString "on,on,on,on"
MaskInitialization "K=@1;num_lin=@2;TDelay=@3;Sample=@4;"
MaskDisplay "disp('Error\\nmeter')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "1|10|12|1"
MaskVariableAliases ",,,"
System {
Name "Error rate"
Location [255, 368, 509, 510]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [15, 45, 35, 65]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType Inport
Name "in_2"
Position [15, 60, 35, 80]
Port "2"
LatchInput off
Interpolate on
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [65, 46, 100, 79]
Inputs "2"
DisplayOption "none"
}
Block {
BlockType "S-Function"
Name "S-function"
Ports [1]
Position [130, 52, 195, 78]
FunctionName "sbiterr"
Parameters "num_lin, K, TDelay, Sample"
PortCounts "[]"
SFunctionModules "''"
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "S-function"
DstPort 1
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "in_2"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "MASK demap"
Ports [1, 1]
Position [135, 183, 215, 227]
ShowPortLabels off
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
MaskType "MASK demap"
MaskDescription "Reverse the MASK mapping process\nConvert [-1 1"
"] analog signal to [0, M-1] symbols."
MaskHelp "This block demaps a MASK mapped signal back to "
"digit symbols. You can place this block after a amplitude demodulation block."
" The input of this block is an analog signal in the range [-1, 1]. The demodu"
"lation decides the closest integer fitting in [0,M-1] range. When the input s"
"ymbol interval is a two-elements vector, the second element is offset. The de"
"fault offset value is 0."
MaskPromptString "M-ary number (digit integers in ranger [0, M-1]"
"):|Output symbol interval and offset (sec):"
MaskStyleString "edit,edit"
MaskTunableValueString "on,on"
MaskCallbackString "|"
MaskEnableString "on,on"
MaskVisibilityString "on,on"
MaskToolTipString "on,on"
MaskInitialization "N=@1;Ac=1;sft=[0:N-1]*Ac*2/(N-1)-Ac;td=@2;"
MaskDisplay "disp('MASK\\ndemap')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "4|[1, .9]"
MaskVariableAliases ","
System {
Name "MASK demap"
Location [80, 334, 521, 474]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "in_1"
Position [30, 35, 50, 55]
Port "1"
LatchInput off
Interpolate on
}
Block {
BlockType Abs
Name "Abs"
Position [235, 42, 270, 68]
SaturateOnIntegerOverflow on
}
Block {
BlockType "S-Function"
Name "Minimum"
Ports [1, 1]
Position [315, 45, 370, 65]
FunctionName "arymimai"
Parameters "'min'"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Constant
Name "Shift key"
Position [115, 93, 135, 117]
Value "sft"
VectorParams1D on
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [180, 38, 200, 67]
IconShape "rectangular"
Inputs "+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold"
Position [85, 29, 120, 61]
SampleTime "td"
}
Block {
BlockType Outport
Name "out_1"
Position [400, 45, 420, 65]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "in_1"
SrcPort 1
DstBlock "Zero-Order\nHold"
DstPort 1
}
Line {
SrcBlock "Abs"
SrcPort 1
DstBlock "Minimum"
DstPort 1
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Minimum"
SrcPort 1
DstBlock "out_1"
DstPort 1
}
Line {
SrcBlock "Shift key"
SrcPort 1
Points [15, 0; 0, -45]
DstBlock "Sum2"
DstPort 2
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -