📄 fir_test.mdl
字号:
FunctionWithSeparateData off
MaskHelp "This block implements a combination of switches and an FIR filter. By using appropriate combinations of DIP switches 0 and 1, it is possible to get filtered and unfiltered signals from Line-in or stored variable to the DSP board output. Put the FIR filter coefficients in the variable dialog box. By default, it takes the values from the variable Num in the Matlab workspace."
MaskPromptString "FIR filter coefficients"
MaskStyleString "edit"
MaskTunableValueString "on"
MaskEnableString "on"
MaskVisibilityString "on"
MaskToolTipString "on"
MaskVariables "Num=@1;"
MaskInitialization "load corrupted_speech_data;"
MaskDisplay "disp('Switched Filter\\n\nBlock');\nport_label('input', 1, 'Stored');\nport_label('input', 2, 'Line');\nport_label('output', 1, 'Output');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "Num"
System {
Name "FILTER"
Location [416, 280, 999, 602]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [15, 43, 45, 57]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType Inport
Name "In2"
Position [15, 123, 45, 137]
Port "2"
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Block {
BlockType DataTypeConversion
Name "Conversion2"
Position [65, 115, 115, 145]
NamePlacement "alternate"
ShowName off
OutDataTypeMode "Specify via dialog"
OutDataType "sfix(16)"
OutScaling "2^(-15)"
ConvertRealWorld "Stored Integer (SI)"
RndMeth "Floor"
SaturateOnIntegerOverflow off
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 4]
Position [243, 215, 312, 220]
Orientation "up"
BackgroundColor "black"
NamePlacement "alternate"
ShowName off
DisplayOption "bar"
Port {
PortNumber 1
Name "DIP Switch 0"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 2
Name "DIP Switch 1"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 3
Name "DIP Switch 2"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
Port {
PortNumber 4
Name "DIP Switch 3"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
}
}
Block {
BlockType Reference
Name "Digital FIR Filter"
Ports [1, 1]
Position [245, 24, 325, 66]
DialogController "dspdialog.DigitalFilter"
DialogControllerArgs "DataTag1"
SourceBlock "dsparch4/Digital Filter"
SourceType "Digital Filter"
TypePopup "FIR (all zeros)"
IIRFiltStruct "Direct form II transposed"
AllPoleFiltStruct "Direct form"
FIRFiltStruct "Direct form"
CoeffSource "Specify via dialog"
NumCoeffs "Num"
DenCoeffs "[1 0.1]"
BiQuadCoeffs "[1 0.3 0.4 1 0.1 0.2]"
LatticeCoeffs "[0.2 0.4]"
denIgnore on
FiltPerSampPopup "One filter per frame"
IC "0"
ICnum "0"
ICden "0"
additionalParams off
allowOverrides on
showCoeff off
firstCoeffMode "Same word length as input"
firstCoeffWordLength "16"
firstCoeffFracLength "15"
secondCoeffMode "Same as numerator"
secondCoeffWordLength "16"
secondCoeffFracLength "15"
thirdCoeffMode "Same as input"
thirdCoeffWordLength "16"
thirdCoeffFracLength "15"
showOut off
outputMode "Same as accumulator"
outputWordLength "16"
outputFracLength "15"
showAcc off
accumMode "Same as product output"
accumWordLength "32"
accumFracLength "30"
showMpy off
prodOutputMode "Same as input"
prodOutputWordLength "32"
prodOutputFracLength "30"
showMem off
memoryMode "Same as accumulator"
memoryWordLength "16"
memoryFracLength "15"
roundingMode "Floor"
overflowMode off
ScaleValues "1"
scaleValueFracLength "14"
tapSumMode "Same as input"
tapSumWordLength "32"
tapSumFracLength "30"
stageIOMode "Same as input"
stageIOWordLength "16"
stageInFracLength "15"
stageOutFracLength "15"
LockScale off
FilterSource "Specify via dialog"
dfiltObjectName "dfilt.dffir([1 2 1])"
multiplicandMode "Same as output"
multiplicandWordLength "32"
multiplicandFracLength "30"
}
Block {
BlockType Switch
Name "Input Selection\nSwitch"
Position [160, 31, 200, 149]
Criteria "u2 ~= 0"
InputSameDT off
SaturateOnIntegerOverflow off
}
Block {
BlockType Switch
Name "Output Selection\nSwitch"
Position [460, 26, 500, 144]
Criteria "u2 ~= 0"
InputSameDT off
SaturateOnIntegerOverflow off
}
Block {
BlockType Reference
Name "Switch"
Ports [0, 1]
Position [233, 255, 327, 305]
Orientation "up"
NamePlacement "alternate"
SourceBlock "c6416dsklib/Switch"
SourceType "C6416 DSK DIP Switch"
sw0 on
sw1 on
sw2 off
sw3 off
dType "Boolean"
Ts "1/fs"
}
Block {
BlockType Terminator
Name "Terminator"
Position [395, 150, 415, 170]
NamePlacement "alternate"
}
Block {
BlockType Terminator
Name "Terminator1"
Position [395, 195, 415, 215]
}
Block {
BlockType Outport
Name "Out1"
Position [535, 78, 565, 92]
IconDisplay "Port number"
OutDataType "sfix(16)"
OutScaling "2^0"
}
Line {
SrcBlock "Digital FIR Filter"
SrcPort 1
DstBlock "Output Selection\nSwitch"
DstPort 1
}
Line {
SrcBlock "Switch"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
Name "DIP Switch 3"
Labels [-1, 0]
SrcBlock "Demux"
SrcPort 4
Points [0, -5]
DstBlock "Terminator1"
DstPort 1
}
Line {
Name "DIP Switch 2"
Labels [2, 0]
SrcBlock "Demux"
SrcPort 3
Points [0, -50]
DstBlock "Terminator"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -