📄 adapred.mdl
字号:
"g\n>> load noisy\n>> load clean\n\nListen to the above signals\n>> soundsc(no"
"isy_mtlb(2,:));\n>>soundsc(clean_mtlb(2,:));"
MaskDisplay "disp('Instruction to run this simulation')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name " "
Location [2, 74, 1014, 724]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Annotation {
Name "Adaptive One-Step Linear Prediction\n\nThis"
" demonstrates the ability of the LMS Adaptive FIR\nalgorithm to adaptively co"
"mpute the linear prediction\ncoefficients for a noisy input signal.\n\nFor mo"
"re information on LMS filtering, see\nS. Haykin, \"Adaptive Filter Theory\","
"\n3rd Ed., Prentice Hall, 1996.\n"
Position [182, 94]
FontName "Arial"
FontSize 14
}
}
}
Block {
BlockType Reference
Name "Flip"
Ports [1, 1]
Position [360, 201, 395, 229]
SourceBlock "dspindex/Flip"
SourceType "Flip"
dim "Columns"
}
Block {
BlockType Reference
Name "Integer Delay"
Ports [1, 1]
Position [180, 152, 225, 188]
ShowName off
SourceBlock "dspsigops/Integer Delay"
SourceType "Integer Delay"
delay "1"
ic "0"
reset_popup "None"
}
Block {
BlockType Reference
Name "LMS\nAdaptive Filter"
Ports [2, 2]
Position [255, 156, 340, 214]
SourceBlock "dspadpt3/LMS\nAdaptive Filter"
SourceType "LMS Adaptive Filter"
n "16"
mu "0.1"
ic "0.0"
leakage "1.0"
normalized on
Adapt off
RstPort "None"
Port {
PortNumber 1
Name "Prediction"
PropagatedSignals "y[k]"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType Reference
Name "Predictor\nCoefficients"
Ports [1]
Position [420, 190, 455, 240]
SourceBlock "dspsnks4/Vector\nScope"
SourceType "Vector Scope"
ScopeProperties on
Domain "User-defined"
HorizSpan "1"
DisplayProperties off
AxisGrid on
Memory off
FrameNumber on
AxisLegend off
AxisZoom on
OpenScopeAtSimStart on
OpenScopeImmediately off
FigPos "[222 254 343 297]"
AxisProperties off
XUnits "Hertz"
XRange "[0...Fs/2]"
InheritXIncr off
XIncr "1"
XLabel "Samples"
YUnits "dB"
YMin "-1.97522775023821"
YMax "2.77453432806668"
YLabel "Amplitude"
LineProperties off
}
Block {
BlockType Scope
Name "Results"
Ports [3]
Position [445, 84, 480, 136]
ShowName off
Location [580, 186, 922, 569]
Open on
NumInputPorts "3"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
axes3 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
axes2 ""
axes3 ""
}
TimeRange "0.1"
YMin "-2~-2~-2"
YMax "2~2~2"
DataFormat "Array"
SampleInput on
SampleTime "1/8000"
}
Block {
BlockType Reference
Name "Sine Wave"
Ports [0, 1]
Position [30, 103, 60, 137]
NamePlacement "alternate"
SourceBlock "dspsrcs4/Sine Wave"
SourceType "Sine Wave"
Amplitude "0.5"
Frequency "1000"
Phase "0"
SampleMode "Discrete"
OutComplex "Real"
CompMethod "Trigonometric fcn"
TableSize "Speed"
SampleTime "1/8000"
SamplesPerFrame "1"
additionalParams off
dataType "double"
wordLen "16"
udDataType "sfix(16)"
fracBitsMode "User-defined"
numFracBits "14"
ResetState "Restart at time zero"
}
Block {
BlockType Reference
Name "Source"
Ports [0, 1]
Position [15, 198, 70, 232]
SourceBlock "dspsrcs4/Signal From\nWorkspace"
SourceType "Signal From Workspace"
X "mtlb"
Ts "1/8000"
nsamps "1"
OutputAfterFinalValue "Setting to zero"
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1]
Position [340, 95, 370, 125]
ShowName off
IconShape "round"
Inputs "|+-"
Port {
PortNumber 1
Name "Prediction\nerror"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "1"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType Sum
Name "Sum4"
Ports [2, 1]
Position [105, 160, 135, 190]
ShowName off
IconShape "round"
Port {
PortNumber 1
Name "Input signal"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "1"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType ToFile
Name "To File"
Position [490, 40, 550, 70]
Filename "clean.mat"
MatrixName "clean_mtlb"
}
Block {
BlockType ToFile
Name "To File1"
Position [205, 255, 265, 285]
Filename "noisy.mat"
MatrixName "noisy_mtlb"
}
Line {
Name "Input signal"
SrcBlock "Sum4"
SrcPort 1
Points [0, -5; 15, 0]
Branch {
Points [10, 0]
Branch {
DstBlock "Integer Delay"
DstPort 1
}
Branch {
Points [0, 100]
DstBlock "To File1"
DstPort 1
}
}
Branch {
Points [0, -60]
Branch {
Labels [2, 0]
Points [0, -35; 275, 0]
DstBlock "Results"
DstPort 1
}
Branch {
DstBlock "Sum3"
DstPort 1
}
}
}
Line {
SrcBlock "LMS\nAdaptive Filter"
SrcPort 2
DstBlock "Flip"
DstPort 1
}
Line {
SrcBlock "Integer Delay"
SrcPort 1
DstBlock "LMS\nAdaptive Filter"
DstPort 1
}
Line {
SrcBlock "Sine Wave"
SrcPort 1
Points [10, -10; 45, 0]
DstBlock "Sum4"
DstPort 1
}
Line {
Name "Prediction"
Labels [0, 0]
SrcBlock "LMS\nAdaptive Filter"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Labels [1, 0]
Points [75, 0]
DstBlock "Results"
DstPort 3
}
Branch {
DstBlock "Sum3"
DstPort 2
}
}
Line {
Name "Prediction\nerror"
Labels [0, 0]
SrcBlock "Sum3"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, -25; -150, 0]
DstBlock "LMS\nAdaptive Filter"
DstPort 2
}
Branch {
Points [20, 0]
Branch {
DstBlock "Results"
DstPort 2
}
Branch {
Points [0, -55]
DstBlock "To File"
DstPort 1
}
}
}
Line {
SrcBlock "Flip"
SrcPort 1
DstBlock "Predictor\nCoefficients"
DstPort 1
}
Line {
SrcBlock "Source"
SrcPort 1
Points [45, 0]
DstBlock "Sum4"
DstPort 2
}
Annotation {
Name "LMS Adaptive Linear Prediction"
Position [291, 21]
FontName "MS Sans Serif"
FontSize 14
FontWeight "bold"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -