dds_n1.mdl
来自「用MATLAB中的SIMULINK工具实现DDS的仿真模型」· MDL 代码 · 共 1,847 行 · 第 1/4 页
MDL
1,847 行
BlockType Outport
Name "Out1"
Position [190, 93, 220, 107]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Calculate single tone \nfrequency"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Calculate single tone \nfrequency"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Calculate single tone \nfrequency"
DstPort trigger
}
}
}
Block {
BlockType Reference
Name "Power Spectral\nDensity"
Ports [1]
Position [730, 315, 760, 345]
SourceBlock "simulink_extras/Additional\nSinks/Power Spectra"
"l\nDensity"
SourceType "Power Spectral Density"
ShowPortLabels on
npts "512"
fftpts "512"
HowOften "128"
sampleT "1/RF"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [200, 33, 245, 67]
PulseType "Time based"
Period "1/RF"
PulseWidth "50"
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [790, 109, 820, 141]
Location [72, 331, 686, 680]
Open off
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-0.9"
YMax "0.9"
SaveToWorkspace on
DataFormat "Array"
MaxDataPoints "1500000"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [720, 389, 750, 421]
Location [188, 390, 512, 629]
Open off
NumInputPorts "1"
ZoomMode "xonly"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "0.95"
YMax "1.05"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Reference
Name "Spectrum\nAnalyzer"
Ports [2]
Position [675, 472, 705, 503]
SourceBlock "simulink_extras/Additional\nSinks/Spectrum\nAna"
"lyzer"
SourceType "Spectrum Analyzer"
ShowPortLabels on
npts "256"
fftpts "512"
HowOften "32"
sampleT "1/RF"
}
Block {
BlockType Step
Name "Step"
Position [110, 145, 140, 175]
Time "400/RF"
Before "K"
After "2*K"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [1, 1]
Position [410, 95, 450, 155]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Subsystem"
Location [127, 139, 497, 325]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 48, 55, 62]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Product
Name "Divide"
Ports [2, 1]
Position [155, 126, 185, 159]
Inputs "*/"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [210, 32, 240, 63]
InputSameDT off
OutDataTypeMode "double"
SaturateOnIntegerOverflow off
}
Block {
BlockType Trigonometry
Name "Trigonometric\nFunction"
Ports [1, 1]
Position [260, 35, 290, 65]
}
Block {
BlockType SubSystem
Name "period\nSubsystem"
Ports [1, 2]
Position [80, 25, 120, 85]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "period\nSubsystem"
Location [565, 144, 950, 536]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [105, 28, 135, 42]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Math
Name "Math\nFunction"
Ports [2, 1]
Position [160, 27, 190, 58]
Operator "mod"
OutputSignalType "real"
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [0, 1]
Position [25, 125, 65, 185]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Subsystem"
Location [570, 194, 770, 341]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Constant
Name "2"
Position [25, 25, 55, 55]
Value "2"
}
Block {
BlockType Math
Name "Math\nFunction1"
Ports [2, 1]
Position [90, 41, 120, 74]
Operator "pow"
OutputSignalType "real"
}
Block {
BlockType Constant
Name "N"
Position [25, 90, 55, 120]
Value "N"
}
Block {
BlockType Outport
Name "Out1"
Position [145, 53, 175, 67]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "N"
SrcPort 1
Points [10, 0; 0, -40]
DstBlock "Math\nFunction1"
DstPort 2
}
Line {
SrcBlock "2"
SrcPort 1
Points [0, 10]
DstBlock "Math\nFunction1"
DstPort 1
}
Line {
SrcBlock "Math\nFunction1"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "Out1"
Position [215, 38, 245, 52]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "Out2"
Position [215, 113, 245, 127]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Math\nFunction"
DstPort 1
}
Line {
SrcBlock "Math\nFunction"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Subsystem"
SrcPort 1
Points [5, 0; 0, -35]
Branch {
Points [0, -70]
DstBlock "Math\nFunction"
DstPort 2
}
Branch {
DstBlock "Out2"
DstPort 1
}
}
}
}
Block {
BlockType Constant
Name "pi"
Position [80, 120, 110, 150]
Value "2*pi"
}
Block {
BlockType Outport
Name "Out1"
Position [315, 43, 345, 57]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "period\nSubsystem"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Trigonometric\nFunction"
DstPort 1
}
Line {
SrcBlock "pi"
SrcPort 1
DstBlock "Divide"
DstPort 1
}
Line {
SrcBlock "Divide"
SrcPort 1
Points [5, 0]
DstBlock "Product"
DstPort 2
}
Line {
SrcBlock "period\nSubsystem"
SrcPort 2
Points [5, 0; 0, 80]
DstBlock "Divide"
DstPort 2
}
Line {
SrcBlock "Trigonometric\nFunction"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "period\nSubsystem"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Subsystem1"
Ports [1, 2]
Position [630, 390, 670, 450]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Subsystem1"
Location [487, 526, 827, 688]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 28, 55, 42]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Constant
Name "Constant1"
Position [30, 75, 60, 105]
Value "0"
}
Block {
BlockType SubSystem
Name "Frequency of\nsingle tone"
Ports [1, 1]
Position [155, 83, 260, 137]
ShowName off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskDisplay "disp('Single Tone\\nFrequency Estimator');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Frequency of\nsingle tone"
Location [181, 209, 446, 413]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [110, 25, 140, 40]
Orientation "down"
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType SubSystem
Name "Calculate single tone \nfrequency"
Ports [1, 1, 0, 1]
Position [90, 73, 165, 127]
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Calculate single tone \nfrequency"
Location [99, 524, 780, 705]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?