adnc_lms.mdl

来自「数字信号处理(机械工业出版社)的源码」· MDL 代码 · 共 724 行 · 第 1/2 页

MDL
724 行
字号
	  Position		  [235, 110]
	  FontName		  "Arial"
	  FontSize		  14
	}
      }
    }
    Block {
      BlockType		      Reference
      Name		      "Filter\nTaps"
      Ports		      [1]
      Position		      [305, 200, 340, 250]
      SourceBlock	      "dspsnks4/Vector\nScope"
      SourceType	      "Vector Scope"
      ScopeProperties	      off
      Domain		      "User-defined"
      HorizSpan		      "1"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      on
      AxisLegend	      off
      AxisZoom		      on
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "[66 155 329 270]"
      AxisProperties	      on
      XUnits		      "Hertz"
      XRange		      "[0...Fs/2]"
      InheritXIncr	      on
      XIncr		      "1"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-0.2"
      YMax		      "0.6"
      YLabel		      "Filter Coefficients"
      LineProperties	      off
      LineDisables	      "on"
      LineStyles	      ":"
      LineMarkers	      "."
      LineColors	      "[0 0 1]"
    }
    Block {
      BlockType		      Reference
      Name		      "Flip"
      Ports		      [1, 1]
      Position		      [240, 211, 275, 239]
      SourceBlock	      "dspindex/Flip"
      SourceType	      "Flip"
      dim		      "Columns"
    }
    Block {
      BlockType		      Reference
      Name		      "Freq\nResponse"
      Ports		      [1]
      Position		      [240, 260, 275, 310]
      SourceBlock	      "dspsnks4/Spectrum\nScope"
      SourceType	      "Spectrum Scope"
      ScopeProperties	      off
      Domain		      "Frequency"
      HorizSpan		      "1"
      UseBuffer		      off
      BufferSize	      "128"
      Overlap		      "64"
      inpFftLenInherit	      on
      FFTlength		      "256"
      numAvg		      "2"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      off
      AxisLegend	      off
      AxisZoom		      on
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "[404 155 378 270]"
      AxisProperties	      on
      XUnits		      "Hertz"
      XRange		      "[0...Fs/2]"
      InheritXIncr	      on
      XIncr		      "1"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-60"
      YMax		      "0"
      YLabel		      "Magnitude, dB"
      LineProperties	      off
      LineDisables	      "on"
      LineStyles	      "-"
      LineColors	      "[0 0 1]"
    }
    Block {
      BlockType		      Reference
      Name		      "LMS\nAdaptive Filter"
      Ports		      [2, 2]
      Position		      [120, 181, 205, 239]
      SourceBlock	      "dspadpt3/LMS\nAdaptive Filter"
      SourceType	      "LMS Adaptive Filter"
      n			      "32"
      mu		      "0.5"
      ic		      "0.0"
      leakage		      "1.0"
      normalized	      on
      Adapt		      off
      RstPort		      "None"
    }
    Block {
      BlockType		      Reference
      Name		      "Noise"
      Ports		      [0, 1]
      Position		      [45, 121, 80, 159]
      Diagnostics	      "AllowInheritedTsInSrc"
      SourceBlock	      "dspsrcs4/Random\nSource"
      SourceType	      "Random Source"
      SrcType		      "Gaussian"
      NormMethod	      "Ziggurat"
      CltLength		      "12"
      Min		      "0"
      Max		      "1"
      Mean		      "0"
      Var		      "1"
      RepMode		      "Specify seed"
      Seed		      "[23341]"
      Inherit		      off
      SampMode		      "Discrete"
      SampTime		      "1"
      SampFrame		      "1"
      DataType		      "Double"
      OutComplex	      "Real"
    }
    Block {
      BlockType		      Reference
      Name		      "Noise Filter"
      Ports		      [1, 1]
      Position		      [135, 116, 190, 164]
      SourceBlock	      "dspddes3/Digital FIR\nFilter Design"
      SourceType	      "Digital FIR Filter Design"
      filttype		      "Lowpass"
      N			      "31"
      Wlo		      "0.5"
      Whi		      "0.6"
      W0		      "[.2 .5 .8]"
      g0		      "1"
      W1		      "[0 .2 .3 .6 .8 1]"
      gains		      "[1 .5 0 0 1 .5]"
      wintype		      "Hamming"
      Rs		      "10"
      Kbeta		      "5"
    }
    Block {
      BlockType		      Scope
      Name		      "Results"
      Ports		      [3]
      Position		      [395, 60, 425, 100]
      Location		      [418, 80, 795, 500]
      Open		      on
      NumInputPorts	      "3"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
	axes2			"%<SignalLabel>"
	axes3			"%<SignalLabel>"
      }
      List {
	ListType		SelectedSignals
	axes1			""
	axes2			""
	axes3			""
      }
      TimeRange		      "128"
      YMin		      "-2~-2~-2"
      YMax		      "2~2~2"
      DataFormat	      "Array"
    }
    Block {
      BlockType		      Reference
      Name		      "Sine Wave"
      Ports		      [0, 1]
      Position		      [70, 43, 115, 87]
      SourceBlock	      "dspsrcs4/Sine Wave"
      SourceType	      "Sine Wave"
      Amplitude		      "1"
      Frequency		      "0.055"
      Phase		      "0"
      SampleMode	      "Discrete"
      OutComplex	      "Real"
      CompMethod	      "Trigonometric fcn"
      TableSize		      "Speed"
      SampleTime	      "1"
      SamplesPerFrame	      "1"
      additionalParams	      off
      dataType		      "double"
      wordLen		      "16"
      udDataType	      "sfix(16)"
      fracBitsMode	      "Best precision"
      numFracBits	      "14"
      ResetState	      "Restart at time zero"
      Port {
	PortNumber		1
	Name			"Input Signal"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Block {
      BlockType		      Sum
      Name		      "Sum2"
      Ports		      [2, 1]
      Position		      [215, 130, 235, 150]
      ShowName		      off
      IconShape		      "round"
      Inputs		      "++|"
      Port {
	PortNumber		1
	Name			"Signal + Noise"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Block {
      BlockType		      Sum
      Name		      "Sum3"
      Ports		      [2, 1]
      Position		      [280, 130, 300, 150]
      ShowName		      off
      IconShape		      "round"
      Inputs		      "|+-"
      Port {
	PortNumber		1
	Name			"Error Signal"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Line {
      Name		      "Input Signal"
      Labels		      [0, 0]
      SrcBlock		      "Sine Wave"
      SrcPort		      1
      Points		      [30, 0; 75, 0]
      Branch {
	DstBlock		"Sum2"
	DstPort			1
      }
      Branch {
	Labels			[1, 0]
	DstBlock		"Results"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Noise Filter"
      SrcPort		      1
      DstBlock		      "Sum2"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Noise"
      SrcPort		      1
      Points		      [0, 0; 20, 0]
      Branch {
	DstBlock		"LMS\nAdaptive Filter"
	DstPort			1
      }
      Branch {
	DstBlock		"Noise Filter"
	DstPort			1
      }
    }
    Line {
      Name		      "Signal + Noise"
      SrcBlock		      "Sum2"
      SrcPort		      1
      Points		      [0, 0; 15, 0]
      Branch {
	DstBlock		"Sum3"
	DstPort			1
      }
      Branch {
	Labels			[2, 1]
	Points			[0, -60]
	DstBlock		"Results"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "LMS\nAdaptive Filter"
      SrcPort		      1
      Points		      [80, 0]
      DstBlock		      "Sum3"
      DstPort		      2
    }
    Line {
      SrcBlock		      "LMS\nAdaptive Filter"
      SrcPort		      2
      Points		      [0, 0; 5, 0]
      Branch {
	Points			[0, 60]
	DstBlock		"Freq\nResponse"
	DstPort			1
      }
      Branch {
	DstBlock		"Flip"
	DstPort			1
      }
    }
    Line {
      Name		      "Error Signal"
      Labels		      [0, 1]
      SrcBlock		      "Sum3"
      SrcPort		      1
      Points		      [0, 0; 65, 0]
      Branch {
	Points			[0, -45]
	DstBlock		"Results"
	DstPort			3
      }
      Branch {
	Points			[0, 200; -265, 0]
	DstBlock		"LMS\nAdaptive Filter"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "Flip"
      SrcPort		      1
      DstBlock		      "Filter\nTaps"
      DstPort		      1
    }
    Annotation {
      Name		      "Adaptive Noise Cancellation Demo"
      Position		      [247, 27]
      FontName		      "Arial"
      FontSize		      12
      FontWeight	      "bold"
    }
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?