📄 ex5_fir.mdl
字号:
Block {
BlockType Reference
Name "FIR2"
Ports [1, 1]
Position [450, 335, 665, 385]
SourceBlock "fixpt_lib_4/Filters/FIR"
SourceType "Fixed-Point FIR"
mgainval "[0.1:0.1:1 0.9:-0.1:0.1]"
vinit "0.0"
samptime "-1"
GainDataTypeScalingMode "Specify via dialog"
GainDataType "sfix(16)"
GainScaling "2^-14"
MatRadixGroup "Best Precision: Matrix-wise"
OutputDataTypeScalingMode "Specify via dialog"
OutDataType "sfix(16)"
OutScaling "2^-15"
LockScale off
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "FixPt to Dbl1"
Ports [1, 1]
Position [725, 231, 770, 269]
SourceBlock "fixpt_lib_4/Data Type/Gateway Out"
SourceType "Fixed-Point Gateway Out"
OutRealWorld "Real World Value"
OutBuiltInType "double"
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "FixPt to Dbl2"
Ports [1, 1]
Position [725, 341, 770, 379]
SourceBlock "fixpt_lib_4/Data Type/Gateway Out"
SourceType "Fixed-Point Gateway Out"
OutRealWorld "Real World Value"
OutBuiltInType "double"
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Reference
Name "FixPtGUI"
Ports []
Position [246, 135, 286, 179]
BackgroundColor "orange"
ShowName off
SourceBlock "fixpt_lib_3p1/FixPt\nGUI"
SourceType "Fixed-Point GUI"
}
Block {
BlockType SubSystem
Name "Fixed Point\nTestSignal"
Ports [0, 1]
Position [90, 34, 190, 116]
FontName "MS Sans Serif"
TreatAsAtomicUnit off
MaskDisplay "fprintf('Sine Waves\\n0.5 @ 2Hz\\nplus\\n0.5 @ "
"80Hz')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Fixed Point\nTestSignal"
Location [90, 447, 518, 595]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Reference
Name "Dbl To FixPt1"
Ports [1, 1]
Position [245, 26, 290, 64]
SourceBlock "fixpt_lib_4/Data Type/Gateway In"
SourceType "Fixed-Point Gateway In"
InRealWorld "Real World Value"
OutputDataTypeScalingMode "Specify via dialog"
OutDataType "sfix(16)"
OutScaling "2^(-15)"
LockScale on
RndMeth "Floor"
DoSatur on
}
Block {
BlockType SignalGenerator
Name "Signal\nGenerator1"
Position [25, 30, 55, 60]
Amplitude "0.5"
Frequency "2"
}
Block {
BlockType SignalGenerator
Name "Signal\nGenerator2"
Position [25, 90, 55, 120]
Amplitude "0.5"
Frequency "80"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [105, 35, 125, 55]
ShowName off
IconShape "round"
Inputs "|++"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold"
Position [165, 30, 195, 60]
SampleTime "0.005"
}
Block {
BlockType Outport
Name "u"
Position [315, 38, 345, 52]
FontName "MS Sans Serif"
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
DstBlock "Dbl To FixPt1"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Zero-Order\nHold"
DstPort 1
}
Line {
Labels [1, 0]
SrcBlock "Signal\nGenerator1"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Signal\nGenerator2"
SrcPort 1
Points [55, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Dbl To FixPt1"
SrcPort 1
DstBlock "u"
DstPort 1
}
}
}
Block {
BlockType Reference
Name "Gateway Out"
Ports [1, 1]
Position [265, 56, 310, 94]
SourceBlock "fixpt_lib_4/Data Type/Gateway Out"
SourceType "Fixed-Point Gateway Out"
OutRealWorld "Real World Value"
OutBuiltInType "double"
RndMeth "Floor"
DoSatur off
Port {
PortNumber 1
Name "Unfiltered Input"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType Reference
Name "Gateway Out1"
Ports [1, 1]
Position [280, 236, 325, 274]
SourceBlock "fixpt_lib_4/Data Type/Gateway Out"
SourceType "Fixed-Point Gateway Out"
OutRealWorld "Real World Value"
OutBuiltInType "single"
RndMeth "Floor"
DoSatur off
}
Block {
BlockType Mux
Name "Mux"
Ports [3, 1]
Position [925, 116, 935, 184]
ShowName off
Inputs "3"
DisplayOption "bar"
Port {
PortNumber 1
Name "Filtered Outputs"
PropagatedSignals "Benchmark, , "
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Line {
SrcBlock "Fixed Point\nTestSignal"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
DstBlock "Gateway Out"
DstPort 1
}
Branch {
Points [0, 180]
Branch {
DstBlock "Gateway Out1"
DstPort 1
}
Branch {
Points [0, 100; 220, 0; 0, 10; 5, 0]
DstBlock "FIR2"
DstPort 1
}
}
}
Line {
Name "Filtered Outputs"
Labels [0, 0]
SrcBlock "Mux"
SrcPort 1
Points [0, -20]
DstBlock "Comparison 1"
DstPort 2
}
Line {
Name "Unfiltered Input"
FontName "MS Sans Serif"
Labels [2, 0]
SrcBlock "Gateway Out"
SrcPort 1
Points [0, 0; 80, 0]
Branch {
Points [550, 0; 0, 40]
DstBlock "Comparison 1"
DstPort 1
}
Branch {
Points [0, 60]
DstBlock "FIR"
DstPort 1
}
}
Line {
SrcBlock "FIR2"
SrcPort 1
DstBlock "FixPt to Dbl2"
DstPort 1
}
Line {
SrcBlock "FixPt to Dbl1"
SrcPort 1
Points [100, 0; 0, -100]
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "FixPt to Dbl2"
SrcPort 1
Points [135, 0]
DstBlock "Mux"
DstPort 3
}
Line {
SrcBlock "FIR1"
SrcPort 1
Points [50, 0]
DstBlock "FixPt to Dbl1"
DstPort 1
}
Line {
SrcBlock "Gateway Out1"
SrcPort 1
Points [0, -10]
DstBlock "FIR1"
DstPort 1
}
Line {
Name "Benchmark"
Labels [0, 0]
SrcBlock "FIR"
SrcPort 1
Points [130, 0; 0, -5]
DstBlock "Mux"
DstPort 1
}
Annotation {
Name "Benchmark Implementation using floating point d"
"oubles"
Position [571, 185]
FontName "Arial"
FontSize 18
FontWeight "bold"
}
Annotation {
Name "Using Q.15 format"
Position [561, 420]
FontName "Arial"
FontSize 18
FontWeight "bold"
}
Annotation {
Name "Using floating point single"
Position [566, 300]
FontName "Arial"
FontSize 18
FontWeight "bold"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -