📄 nco.mdl
字号:
SrcBlock "Sum1"
SrcPort 1
Points [0, 30]
DstBlock "Filter1"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, 15]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Filter1"
SrcPort 1
Points [-30, 0]
DstBlock "Manual Switch"
DstPort 2
}
Line {
SrcBlock " 2"
SrcPort 1
Points [0, 0]
DstBlock "Manual Switch"
DstPort 1
}
Line {
SrcBlock "Sum4"
SrcPort 1
Points [140, 0]
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "Sum2"
SrcPort 1
Points [0, 0; 20, 0]
Branch {
DstBlock "Extract Bits"
DstPort 1
}
Branch {
Points [0, 85]
DstBlock "Sum1"
DstPort 1
}
}
Line {
SrcBlock "Manual Switch"
SrcPort 1
Points [0, 0]
DstBlock "Sum2"
DstPort 2
}
Annotation {
Name "Accumulator"
Position [156, 141]
DropShadow on
UseDisplayTextAsClickCallback off
FontSize 18
}
Annotation {
Name "Quantization and Noise Shaping"
Position [607, 143]
DropShadow on
UseDisplayTextAsClickCallback off
FontSize 18
}
Annotation {
Name "Lookup Table"
Position [906, 145]
DropShadow on
UseDisplayTextAsClickCallback off
FontSize 18
}
Annotation {
Name "Phase Dithering"
Position [333, 141]
DropShadow on
UseDisplayTextAsClickCallback off
FontSize 18
}
Annotation {
Name "Numerical Controlled Oscillator"
Position [516, 51]
ForegroundColor "blue"
DropShadow on
UseDisplayTextAsClickCallback off
FontSize 36
}
Annotation {
Position [488, 353]
UseDisplayTextAsClickCallback off
}
}
}
MatData {
NumRecords 1
DataRecord {
Tag DataTag0
Data " %)30 . , 8 ( ! % "
"\" 0 0 "
}
}
# Finite State Machines
#
# Stateflow Version 6.4 (R2006a) dated Mar 31 2006, 16:21:48
#
#
Stateflow {
machine {
id 1
name "NCO"
created "08-Nov-2005 18:11:12"
isLibrary 0
firstTarget 18
debug {
breakOn [1 0 0]
runTimeCheck [0 0 1 1]
}
sfVersion 64014000
}
chart {
id 2
name "Phase Dithering/Bit to Integer Conversion"
windowPosition [240.45 333.75 200.25 189.75]
viewLimits [0 156.75 0 153.75]
screen [1 1 1024 768 1.333333333333333]
treeNode [0 3 0 0]
firstTransition 5
firstJunction 4
viewObj 2
machine 1
decomposition CLUSTER_CHART
type EML_CHART
firstData 6
chartFileNumber 1
disableImplicitCasting 1
eml {
name "fcn"
}
}
state {
id 3
labelString "eML_blk_kernel()"
position [18 64.5 118 66]
fontSize 12
chart 2
treeNode [2 0 0 0]
superState SUBCHART
subviewer 2
type FUNC_STATE
decomposition CLUSTER_STATE
eml {
isEML 1
script "function y = fcn(u)\n"
"% This block supports an embeddable subset of the MATLAB la"
"nguage.\n"
"% See the help menu for details. \n"
"\n"
"y = uint32(2.^[0:19]*u);\n"
"\n"
"% Randomely change the sign of the output based on the firs"
"t bit in the\n"
"% input. Note that the bits of the input are random.\n"
"\n"
"% if (u(1)==0)\n"
"% y=-y;\n"
"% end"
editorLayout "100 M4x1[145 145 576 480]"
fimathString "fimath(...\n"
"'RoundMode', 'floor',...\n"
"'OverflowMode', 'wrap',...\n"
"'ProductMode', 'KeepLSB', 'ProductWordLength', 32,..."
"\n"
"'SumMode', 'KeepLSB', 'SumWordLength', 32,...\n"
"'CastBeforeSum', false)"
treatIntsAsFixpt 0
}
}
junction {
id 4
position [23.5747 49.5747 7]
chart 2
linkNode [2 0 0]
subviewer 2
type CONNECTIVE_JUNCTION
}
transition {
id 5
labelString "{eML_blk_kernel();}"
labelPosition [32.125 19.875 102.544 14.964]
fontSize 12
src {
intersection [0 0 1 0 23.5747 14.625 0 0]
}
dst {
id 4
intersection [7 0 -1 -1 23.5747 42.5747 0 0]
}
midPoint [23.5747 24.9468]
chart 2
linkNode [2 0 0]
dataLimits [21.175 25.975 14.625 42.575]
subviewer 2
drawStyle SMART
executionOrder 1
}
data {
id 6
name "u"
linkNode [2 0 7]
scope INPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
}
complexity SF_COMPLEX_INHERITED
}
dataType "inherited"
fixptType {
slope 1
baseType SF_INT16_TYPE
}
complexity SF_COMPLEX_INHERITED
}
data {
id 7
name "y"
linkNode [2 6 0]
scope OUTPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
}
complexity SF_COMPLEX_INHERITED
}
dataType "inherited"
fixptType {
slope 1
baseType SF_INT16_TYPE
}
complexity SF_COMPLEX_INHERITED
}
instance {
id 8
name "Phase Dithering/Bit to Integer Conversion"
machine 1
chart 2
}
chart {
id 9
name "Subsystem/Embedded\n"
"MATLAB Function"
windowPosition [240.45 333.75 200.25 189.75]
viewLimits [0 156.75 0 153.75]
screen [1 1 1024 768 1.333333333333333]
treeNode [0 10 0 0]
firstTransition 12
firstJunction 11
viewObj 9
machine 1
decomposition CLUSTER_CHART
type EML_CHART
firstData 13
chartFileNumber 3
disableImplicitCasting 1
eml {
name "fcn"
}
}
state {
id 10
labelString "eML_blk_kernel()"
position [18 64.5 118 66]
fontSize 12
chart 9
treeNode [9 0 0 0]
superState SUBCHART
subviewer 9
type FUNC_STATE
decomposition CLUSTER_STATE
eml {
isEML 1
script "function y = fcn(Freq, N, T)\n"
"% This block supports an embeddable subset of the MATLAB la"
"nguage.\n"
"% See the help menu for details. \n"
"\n"
"% N and T are aasigned values in the Model's workspace\n"
"y = uint32(Freq*2^N*T+.5);\n"
""
editorLayout "100 M4x1[52 69 940 333]"
fimathString "fimath(...\n"
"'RoundMode', 'floor',...\n"
"'OverflowMode', 'wrap',...\n"
"'ProductMode', 'KeepLSB', 'ProductWordLength', 32,..."
"\n"
"'SumMode', 'KeepLSB', 'SumWordLength', 32,...\n"
"'CastBeforeSum', false)"
treatIntsAsFixpt 0
}
}
junction {
id 11
position [23.5747 49.5747 7]
chart 9
linkNode [9 0 0]
subviewer 9
type CONNECTIVE_JUNCTION
}
transition {
id 12
labelString "{eML_blk_kernel();}"
labelPosition [32.125 19.875 102.544 14.964]
fontSize 12
src {
intersection [0 0 1 0 23.5747 14.625 0 0]
}
dst {
id 11
intersection [7 0 -1 -1 23.5747 42.5747 0 0]
}
midPoint [23.5747 24.9468]
chart 9
linkNode [9 0 0]
dataLimits [21.175 25.975 14.625 42.575]
subviewer 9
drawStyle SMART
executionOrder 1
}
data {
id 13
name "y"
linkNode [9 0 14]
scope OUTPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
primitive SF_UINT32_TYPE
}
complexity SF_COMPLEX_INHERITED
}
dataType "uint32"
fixptType {
slope 1
baseType SF_INT16_TYPE
}
complexity SF_COMPLEX_INHERITED
}
data {
id 14
name "Freq"
linkNode [9 13 15]
scope INPUT_DATA
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
primitive SF_DOUBLE_TYPE
isSigned 1
wordLength "16"
}
}
dataType "inherited"
}
data {
id 15
name "N"
linkNode [9 14 16]
scope PARAMETER_DATA
initFromWorkspace 1
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
primitive SF_DOUBLE_TYPE
isSigned 1
wordLength "16"
}
}
dataType "inherited"
}
data {
id 16
name "T"
linkNode [9 15 0]
scope PARAMETER_DATA
initFromWorkspace 1
paramIndexForInitFromWorkspace 1
machine 1
props {
array {
size "-1"
}
type {
method SF_INHERITED_TYPE
primitive SF_DOUBLE_TYPE
isSigned 1
wordLength "16"
}
}
dataType "inherited"
}
instance {
id 17
name "Subsystem/Embedded\n"
"MATLAB Function"
machine 1
chart 9
}
target {
id 18
name "sfun"
description "Default Simulink S-Function Target."
codeFlags " debug=1 overflow=1 echo=1"
machine 1
linkNode [1 0 0]
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -