📄 psbfftdemo.mdl
字号:
Block {
BlockType SubSystem
Name "Averager2"
Ports [1, 1]
Position [85, 196, 165, 234]
ShowName off
TreatAsAtomicUnit off
MaskType "Shift Register with discrete state space bl"
"ock"
MaskDescription "This block is a shift register storing valu"
"es [u(k) u(k-1) ... u(k-(Navg-1))]' . This vector can be used for a FFT analy"
"sis."
MaskHelp "This block is a shift register storing valu"
"es [u(k) u(k-1) ... u(k-(Navg-1))]' . This vector can be used for a FFT analy"
"sis."
MaskPromptString "Number of Samples inl. in(k)|Inititial Cond"
"ition|Sample Time (-1 for inherited)"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVarAliasString ",,"
MaskVariables "Navg=@1;x0=@2;Ts=@3;"
MaskInitialization "%Discrete State Space model of averager\n%o"
"ne scalar input\n%Navg sized output [in(k) in(k-1) .... in(k-(Navg-1))]\nQ=ey"
"e(Navg-1);\nA=[Q(:,2:length(Q)) Q(:,1)] ;\nA(1,Navg-1)=0;\nB=[1 ; zeros(Navg"
"-2,1)];\nC=eye(Navg) ;\nC=C(:,2:length(C));\nD=[1 ; zeros(Navg-1,1)];\n\n\n\n"
MaskDisplay "disp('Shift\\nRegister')"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "Navg|0|Ts"
System {
Name "Averager2"
Location [180, 252, 761, 610]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [35, 183, 65, 197]
}
Block {
BlockType DiscreteStateSpace
Name "Discrete State-Space"
Position [155, 172, 275, 208]
A "A"
B "B"
C "C"
D "D"
X0 "x0"
SampleTime "Ts"
}
Block {
BlockType Outport
Name "[u;x]"
Position [350, 183, 380, 197]
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "Discrete State-Space"
DstPort 1
}
Line {
SrcBlock "Discrete State-Space"
SrcPort 1
DstBlock "[u;x]"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Averager3"
Ports [1, 1]
Position [80, 321, 160, 359]
ShowName off
TreatAsAtomicUnit off
MaskType "Shift Register with discrete state space bl"
"ock"
MaskDescription "This block is a shift register storing valu"
"es [u(k) u(k-1) ... u(k-(Navg-1))]' . This vector can be used for a FFT analy"
"sis."
MaskHelp "This block is a shift register storing valu"
"es [u(k) u(k-1) ... u(k-(Navg-1))]' . This vector can be used for a FFT analy"
"sis."
MaskPromptString "Number of Samples inl. in(k)|Inititial Cond"
"ition|Sample Time (-1 for inherited)"
MaskStyleString "edit,edit,edit"
MaskTunableValueString "on,on,on"
MaskCallbackString "||"
MaskEnableString "on,on,on"
MaskVisibilityString "on,on,on"
MaskToolTipString "on,on,on"
MaskVarAliasString ",,"
MaskVariables "Navg=@1;x0=@2;Ts=@3;"
MaskInitialization "%Discrete State Space model of averager\n%o"
"ne scalar input\n%Navg sized output [in(k) in(k-1) .... in(k-(Navg-1))]\nQ=ey"
"e(Navg-1);\nA=[Q(:,2:length(Q)) Q(:,1)] ;\nA(1,Navg-1)=0;\nB=[1 ; zeros(Navg"
"-2,1)];\nC=eye(Navg) ;\nC=C(:,2:length(C));\nD=[1 ; zeros(Navg-1,1)];\n\n\n\n"
MaskDisplay "disp('Shift\\nRegister')"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "Navg|0|Ts"
System {
Name "Averager3"
Location [180, 252, 761, 610]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [35, 183, 65, 197]
}
Block {
BlockType DiscreteStateSpace
Name "Discrete State-Space"
Position [155, 172, 275, 208]
A "A"
B "B"
C "C"
D "D"
X0 "x0"
SampleTime "Ts"
}
Block {
BlockType Outport
Name "[u;x]"
Position [350, 183, 380, 197]
}
Line {
SrcBlock "Discrete State-Space"
SrcPort 1
DstBlock "[u;x]"
DstPort 1
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "Discrete State-Space"
DstPort 1
}
}
}
Block {
BlockType MATLABFcn
Name "MATLAB Fcn\nexecuting\nand plotting\nFFT"
Position [570, 150, 620, 180]
MATLABFcn "fft_function"
OutputDimensions "[ceil(Navg/2) + 5 3]"
Output1D off
}
Block {
BlockType Reference
Name "Matrix\nConcatenation"
Ports [3, 1]
Position [465, 133, 520, 197]
SourceBlock "simulink/Math\nOperations/Matrix\nConcatena"
"tion"
SourceType "Matrix Concatenation"
numInports "3"
catMethod "Horizontal"
}
Block {
BlockType Selector
Name "Selector"
Ports [1, 1]
Position [680, 82, 755, 118]
InputType "Matrix"
Elements "[1:ceil(Navg/2)]"
Rows "1:ceil(Navg/2) "
Columns "1:3"
InputPortWidth "ceil(Navg/2) + 5"
}
Block {
BlockType Selector
Name "Selector1"
Ports [1, 1]
Position [675, 232, 750, 268]
InputType "Matrix"
Elements "[1:ceil(Navg/2)]"
Rows "ceil(Navg/2)+1 : ceil(Navg/2)+5"
Columns "1:3"
InputPortWidth "ceil(Navg/2) + 5"
}
Block {
BlockType ZeroOrderHold
Name "TsFFT"
Position [305, 83, 340, 107]
SampleTime "TsFFT"
}
Block {
BlockType ZeroOrderHold
Name "TsFFT1"
Position [305, 243, 340, 267]
SampleTime "TsFFT"
}
Block {
BlockType ZeroOrderHold
Name "TsFFT2"
Position [305, 368, 340, 392]
SampleTime "TsFFT"
}
Block {
BlockType Outport
Name "F(n)"
Position [865, 122, 890, 138]
}
Block {
BlockType Outport
Name "RMS"
Position [865, 192, 890, 208]
Port "2"
}
Line {
SrcBlock "Matrix\nConcatenation"
SrcPort 1
DstBlock "MATLAB Fcn\nexecuting\nand plotting\nFFT"
DstPort 1
}
Line {
SrcBlock "TsFFT2"
SrcPort 1
Points [45, 0; 0, -195]
DstBlock "Matrix\nConcatenation"
DstPort 3
}
Line {
SrcBlock "f3(k)"
SrcPort 1
DstBlock "Averager3"
DstPort 1
}
Line {
SrcBlock "TsFFT1"
SrcPort 1
Points [35, 0; 0, -90]
DstBlock "Matrix\nConcatenation"
DstPort 2
}
Line {
SrcBlock "TsFFT"
SrcPort 1
Points [35, 0; 0, 50]
DstBlock "Matrix\nConcatenation"
DstPort 1
}
Line {
SrcBlock "f2(k)"
SrcPort 1
DstBlock "Averager2"
DstPort 1
}
Line {
SrcBlock "Averager2"
SrcPort 1
Points [105, 0; 0, 40]
DstBlock "TsFFT1"
DstPort 1
}
Line {
SrcBlock "MATLAB Fcn\nexecuting\nand plotting\nFFT"
SrcPort 1
Points [5, 0; 30, 0]
Branch {
DstBlock "Selector1"
DstPort 1
}
Branch {
Points [0, -65]
DstBlock "Selector"
DstPort 1
}
}
Line {
SrcBlock "Selector"
SrcPort 1
Points [0, 30]
DstBlock "F(n)"
DstPort 1
}
Line {
SrcBlock "Selector1"
SrcPort 1
Points [0, 45; 95, 0]
DstBlock "RMS"
DstPort 1
}
Line {
SrcBlock "f1(k)"
SrcPort 1
DstBlock "Averager1"
DstPort 1
}
Line {
SrcBlock "Averager1"
SrcPort 1
Points [110, 0; 0, 40]
DstBlock "TsFFT"
DstPort 1
}
Line {
SrcBlock "Averager3"
SrcPort 1
Points [60, 0; 0, 40]
DstBlock "TsFFT2"
DstPort 1
}
Annotation {
Name "Beat Ronner\nABB Industrie AG\nTurgi, Switz"
"erland"
Position [544, 53]
}
}
}
Block {
BlockType Sin
Name "Fundamental 100V\n DC=-50 V"
Position [45, 18, 80, 52]
SineType "Time based"
Amplitude "100"
Bias "-50"
Frequency "50*2*pi"
Phase "pi/2"
SampleTime "0"
}
Block {
BlockType Gain
Name "Gain"
Position [240, 53, 270, 77]
ShowName off
}
Block {
BlockType Gain
Name "Gain1"
Position [240, 98, 270, 122]
ShowName off
}
Block {
BlockType Gain
Name "Gain2"
Position [240, 143, 270, 167]
ShowName off
}
Block {
BlockType Display
Name "Shows RMS quantities"
Ports [1]
Position [500, 192, 775, 298]
ForegroundColor "darkGreen"
Format "bank"
Decimation "1"
}
Block {
BlockType Display
Name "Spectrum (harmonics 0-19)"
Ports [1]
Position [500, 32, 775, 158]
ForegroundColor "darkGreen"
Format "bank"
Decimation "1"
}
Block {
BlockType Sum
Name "Sum"
Ports [4, 1]
Position [165, 87, 185, 133]
ShowName off
Inputs "++++"
}
Line {
SrcBlock "Fundamental 100V\n DC=-50 V"
SrcPort 1
Points [50, 0; 0, 60]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "5th harm.\n40 V "
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "11th harm.\n30 V "
SrcPort 1
Points [50, 0; 0, -50]
DstBlock "Sum"
DstPort 3
}
Line {
SrcBlock "FFT"
SrcPort 2
Points [45, 0; 0, 110]
DstBlock "Shows RMS quantities"
DstPort 1
}
Line {
SrcBlock "FFT"
SrcPort 1
Points [0, -5]
DstBlock "Spectrum (harmonics 0-19)"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, 25]
DstBlock "FFT"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [35, 0]
DstBlock "FFT"
DstPort 2
}
Line {
SrcBlock "Gain2"
SrcPort 1
Points [0, -15]
DstBlock "FFT"
DstPort 3
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
DstBlock "Gain1"
DstPort 1
}
Branch {
Points [0, -45]
DstBlock "Gain"
DstPort 1
}
Branch {
Points [0, 45]
DstBlock "Gain2"
DstPort 1
}
}
Line {
SrcBlock "19th harm.\n10 V "
SrcPort 1
Points [65, 0]
DstBlock "Sum"
DstPort 4
}
Annotation {
Name "Demonstration of Simulink FFT facility using ff"
"t_function.m "
Position [421, 346]
FontName "Arial"
FontSize 20
FontWeight "bold"
}
Annotation {
Name "P.D鋒ler, ABB Turgi"
Position [416, 375]
FontSize 12
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -