📄 dds_n64.mdl
字号:
SrcPort 1
Points [35, 0]
Branch {
DstBlock "Memory"
DstPort 1
}
Branch {
Labels [2, 0]
Points [0, -30]
DstBlock "Sum"
DstPort 1
}
}
Annotation {
Name "Ensure frequency calculation\nonly "
"for full period"
Position [507, 151]
}
}
}
Block {
BlockType Clock
Name "Clock"
Position [25, 90, 45, 110]
Decimation "1"
}
Block {
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 RelationalOperator
Name "Relational\nOperator"
Position [95, 27, 125, 58]
Operator ">"
LogicDataType "double"
ZeroCross off
}
Block {
BlockType Outport
Name "Out1"
Position [295, 173, 325, 187]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Constant1"
SrcPort 1
Points [0, -65]
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
Points [20, 0]
DstBlock "Frequency of\nsingle tone"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 1
}
Line {
SrcBlock "Frequency of\nsingle tone"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Constant
Name "Control\nWord"
Position [20, 110, 50, 140]
Value "K"
}
Block {
BlockType SubSystem
Name "Phase\nAccumulator"
Ports [2, 1]
Position [90, 80, 130, 140]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Phase\nAccumulator"
Location [32, 149, 432, 398]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [115, 25, 145, 40]
Orientation "down"
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "In2"
Position [25, 88, 55, 102]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType SubSystem
Name "Triggered\nSubsystem"
Ports [1, 1, 0, 1]
Position [80, 74, 180, 116]
TreatAsAtomicUnit on
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "Triggered\nSubsystem"
Location [353, 328, 855, 680]
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, 103, 140, 117]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType TriggerPort
Name "Trigger"
Ports []
Position [225, 20, 245, 40]
StatesWhenEnabling "held"
}
Block {
BlockType "S-Function"
Name "S-Function"
Ports [1, 1]
Position [225, 95, 285, 125]
FunctionName "addcontrolk"
}
Block {
BlockType Outport
Name "Out1"
Position [360, 103, 390, 117]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "S-Function"
DstPort 1
}
Line {
SrcBlock "S-Function"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "period\nSubsystem"
Ports [1, 1]
Position [235, 65, 275, 125]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "period\nSubsystem"
Location [565, 162, 835, 312]
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 Constant
Name "Constant2"
Position [25, 95, 55, 125]
Value "64"
}
Block {
BlockType Math
Name "Math\nFunction"
Ports [2, 1]
Position [160, 27, 190, 58]
Operator "mod"
OutputSignalType "real"
}
Block {
BlockType Outport
Name "Out1"
Position [215, 38, 245, 52]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Constant2"
SrcPort 1
Points [40, 0; 0, -60]
DstBlock "Math\nFunction"
DstPort 2
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Math\nFunction"
DstPort 1
}
Line {
SrcBlock "Math\nFunction"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "Out1"
Position [300, 88, 330, 102]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Triggered\nSubsystem"
SrcPort 1
DstBlock "period\nSubsystem"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Triggered\nSubsystem"
DstPort trigger
}
Line {
SrcBlock "In2"
SrcPort 1
DstBlock "Triggered\nSubsystem"
DstPort 1
}
Line {
SrcBlock "period\nSubsystem"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "Power Spectral\nDensity"
Ports [1]
Position [365, 65, 395, 95]
SourceBlock "simulink_extras/Additional\nSinks/Power Spectra"
"l\nDensity"
SourceType "Power Spectral Density"
ShowPortLabels on
npts "256"
fftpts "512"
HowOften "128"
sampleT "0.1/RF"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [15, 48, 60, 82]
PulseType "Time based"
Period "1/RF"
PulseWidth "50"
}
Block {
BlockType Reference
Name "RAM\nTable"
Ports [1, 1]
Position [160, 82, 215, 138]
SourceBlock "simulink/Lookup\nTables/Direct Lookup\nTable (n"
"-D)"
SourceType "LookupNDDirect"
maskTabDims "1"
explicitNumDims "1"
outDims "Element"
tabIsInput off
mxTable "[0.0491 0.1467 0.2430 0.3369 0.4276 0.5141 0.59"
"57 0.6716 0.7410 0.8032 0.8577 0.9040 0.9415 0.9700 0.9892 0.9988 0.9988 0.98"
"92 0.9700 0.9415 0.9040 0.8577 0.8032 0.7410 0.6716 0.5957 0.5141 0.4276 0.33"
"69 0.2430 0.1467 0.0491 -0.0491 -0.1467 -0.2430 -0.3369 -0.4276 -0.5141 -0.59"
"57 -0.6716 -0.7410 -0.8032 -0.8577 -0.9040 -0.9415 -0.9700 -0.9892 -0.9988 -0"
".9988 -0.9892 -0.9700 -0.9415 -0.9040 -0.8577 -0.8032 -0.7410 -0.6716 -0.5957"
" -0.5141 -0.4276 -0.3369 -0.2430 -0.1467 -0.0491]"
clipFlag "Warning"
}
Block {
BlockType Scope
Name "Synthedized Wave"
Ports [1]
Position [365, 14, 395, 46]
Location [31, 190, 982, 389]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "-1"
YMax "1"
DataFormat "StructureWithTime"
}
Block {
BlockType Display
Name "Synthesized Frequency\nin Hz"
Ports [1]
Position [410, 180, 500, 210]
Decimation "1"
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [355, 125, 415, 155]
VariableName "simout"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "Array"
FixptAsFi on
}
Block {
BlockType Clock
Name "Clock1"
Position [220, 445, 240, 465]
IOType "siggen"
Decimation "10"
}
Line {
SrcBlock "Calculate \nfrequency\n"
SrcPort 1
DstBlock "Synthesized Frequency\nin Hz"
DstPort 1
}
Line {
SrcBlock "Pulse\nGenerator"
SrcPort 1
Points [5, 0; 0, 30]
DstBlock "Phase\nAccumulator"
DstPort 1
}
Line {
SrcBlock "Control\nWord"
SrcPort 1
DstBlock "Phase\nAccumulator"
DstPort 2
}
Line {
SrcBlock "RAM\nTable"
SrcPort 1
DstBlock "Analog\nFilter Design"
DstPort 1
}
Line {
SrcBlock "Phase\nAccumulator"
SrcPort 1
DstBlock "RAM\nTable"
DstPort 1
}
Line {
SrcBlock "Analog\nFilter Design"
SrcPort 1
Points [0, 0; 20, 0]
Branch {
Points [0, -30]
Branch {
Points [0, -50]
DstBlock "Synthedized Wave"
DstPort 1
}
Branch {
DstBlock "Power Spectral\nDensity"
DstPort 1
}
}
Branch {
Points [0, 30]
Branch {
DstBlock "To Workspace"
DstPort 1
}
Branch {
Points [0, 55]
DstBlock "Calculate \nfrequency\n"
DstPort 1
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -