📄 dsss_demo.mdl
字号:
SrcPort 1
DstBlock "Out2"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
DstBlock "Out3"
DstPort 1
}
}
}
Block {
BlockType Switch
Name "Switch"
Position [330, 35, 360, 65]
Threshold "1"
}
Block {
BlockType Terminator
Name "Terminator"
Position [220, 50, 240, 70]
}
Block {
BlockType Outport
Name "Out1"
Position [395, 43, 425, 57]
InitialOutput "0"
}
Line {
SrcBlock "Scrambler"
SrcPort 1
Points [85, 0]
Branch {
Points [0, 10]
DstBlock "Switch"
DstPort 2
}
Branch {
DstBlock "Switch"
DstPort 1
}
}
Line {
SrcBlock "Switch"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [5, 0; 0, -60]
DstBlock "Switch"
DstPort 3
}
Line {
SrcBlock "Ground"
SrcPort 1
DstBlock "Scrambler"
DstPort 1
}
Line {
SrcBlock "Scrambler"
SrcPort 2
DstBlock "Terminator"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Scrambler"
DstPort 2
}
}
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [265, 117, 295, 148]
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [435, 127, 465, 158]
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [715, 152, 745, 183]
ShowName off
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [265, 173, 295, 217]
Location [367, 53, 685, 415]
Open off
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "5"
YMin "-1"
YMax "1"
DataFormat "StructureWithTime"
SampleTime "0.1"
}
Block {
BlockType SubSystem
Name "Signal source and\nsynchronization pulse"
Ports [0, 3]
Position [20, 106, 120, 214]
ForegroundColor "blue"
TreatAsAtomicUnit off
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Signal source and\nsynchronization pulse"
Location [113, 327, 589, 535]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 282
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [115, 77, 150, 113]
ForegroundColor "blue"
ShowName off
Outputs "2"
}
Block {
BlockType SubSystem
Name "Pulses divide\nsample time1"
Ports [0, 1]
Position [15, 73, 95, 117]
TreatAsAtomicUnit off
MaskType "Pulse generator"
MaskDescription "Vector pulses with sample rate of each puls"
"e as \nSample_time / Divider."
MaskHelp "This block generates a vector pulse. The ou"
"tput length is the same as the divider vector length. The ith element of the "
"output has the sample time Sample_time/Divider(i). All elements in divider mu"
"st be integers."
MaskPromptString "Sample time (scalar, sec):|Divider (integer"
" vector):|Offset (same length as Divider):"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVarAliasString ",,"
MaskVariables "samp_time=@1;out_divid=@2;offset=@3;"
MaskInitialization "[x,y]=srcsicon(2);\n"
MaskDisplay "plot(0,0,100,100,x,y);disp('Pulse')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "1|[1 10]|[0 0]"
System {
Name "Pulses divide\nsample time1"
Location [364, 107, 592, 201]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType "S-Function"
Name "S-function1"
Ports [0, 1]
Position [60, 31, 125, 59]
ShowName off
FunctionName "homopuls"
Parameters "samp_time, out_divid, offset"
}
Block {
BlockType Outport
Name "Outport"
Position [160, 35, 180, 55]
ShowName off
InitialOutput "0"
}
Line {
SrcBlock "S-function1"
SrcPort 1
DstBlock "Outport"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "Triggered Signal\nFrom Workspace"
Ports [1, 1]
Position [195, 11, 295, 49]
SourceBlock "dspsrcs2/Triggered Signal\nFrom Workspace"
SourceType "Triggered Signal From Workspace"
X "randint(10000,1)"
trigtype "Rising edge"
cyclic on
ic "0 "
nsamps "1"
}
Block {
BlockType Outport
Name "Source signal"
Position [350, 23, 380, 37]
InitialOutput "0"
}
Block {
BlockType Outport
Name "Spread spectrum\npulse"
Position [345, 148, 375, 162]
Port "2"
InitialOutput "0"
}
Block {
BlockType Outport
Name "Symbol interval\npulse"
Position [355, 75, 385, 95]
Port "3"
InitialOutput "0"
}
Line {
SrcBlock "Pulses divide\nsample time1"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [20, 0]
Branch {
Points [0, -55]
DstBlock "Triggered Signal\nFrom Workspace"
DstPort 1
}
Branch {
DstBlock "Symbol interval\npulse"
DstPort 1
}
}
Line {
SrcBlock "Triggered Signal\nFrom Workspace"
SrcPort 1
DstBlock "Source signal"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [20, 0; 0, 50]
DstBlock "Spread spectrum\npulse"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "filter in receiver"
Ports []
Position [612, 120, 754, 236]
Orientation "left"
ForegroundColor "gray"
BackgroundColor "gray"
TreatAsAtomicUnit off
MaskDisplay "disp(' ')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "filter in receiver"
Location [360, 145, 485, 217]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
}
}
Line {
SrcBlock "Signal source and\nsynchronization pulse"
SrcPort 2
Points [15, 0; 0, 35]
Branch {
Points [0, 120; 175, 0]
Branch {
DstBlock "PN signal1"
DstPort 1
}
Branch {
Points [270, 0; 0, -155]
DstBlock "Counter1"
DstPort 2
}
}
Branch {
DstBlock "PN signal"
DstPort 1
}
}
Line {
SrcBlock "Counter1"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
Points [40, 0]
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "Signal source and\nsynchronization pulse"
SrcPort 3
Points [0, 130; 475, 0]
DstBlock "Counter1"
DstPort 3
}
Line {
SrcBlock "AWGN\nchannel"
SrcPort 1
DstBlock "Product1"
DstPort 1
}
Line {
SrcBlock "Signal source and\nsynchronization pulse"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "BPSK mod"
DstPort 1
}
Branch {
Points [0, -40; 625, 0; 0, 195]
DstBlock "Error rate"
DstPort 1
}
}
Line {
SrcBlock "BPSK mod"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "BPSK demod"
DstPort 1
}
Line {
SrcBlock "BPSK demod"
SrcPort 1
DstBlock "Counter1"
DstPort 1
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
Points [20, 0; 0, 135]
DstBlock "Error rate"
DstPort 2
}
Line {
SrcBlock "PN signal1"
SrcPort 1
Points [5, 0]
DstBlock "Product1"
DstPort 2
}
Line {
SrcBlock "PN signal"
SrcPort 1
Points [10, 0]
Branch {
Points [-5, 0]
DstBlock "Product"
DstPort 2
}
Branch {
DstBlock "Scope"
DstPort 1
}
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "AWGN\nchannel"
DstPort 1
}
Annotation {
Position [617, 159]
}
Annotation {
Position [172, 389]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -