ch6example1.mdl

来自「清华大学出版社 邵玉斌编写的《通信系统建模与仿真实例分析》一书的所有MATLAB」· MDL 代码 · 共 699 行 · 第 1/2 页

MDL
699
字号
      N			      "50"
      Wlo		      "2*pi*250"
      Whi		      "80"
      Rp		      "2"
      Rs		      "40"
    }
    Block {
      BlockType		      Mux
      Name		      "Mux"
      Ports		      [2, 1]
      Position		      [495, 261, 500, 299]
      ShowName		      off
      Inputs		      "2"
      DisplayOption	      "bar"
      Port {
	PortNumber		1
	Name			"原信号和采样"
	PropagatedSignals	", 采样输出"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Block {
      BlockType		      Product
      Name		      "Product\n采样"
      Ports		      [2, 1]
      Position		      [215, 111, 260, 144]
      InputSameDT	      off
      Port {
	PortNumber		1
	Name			"采样输出"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Block {
      BlockType		      DiscretePulseGenerator
      Name		      "Pulse\nGenerator"
      Position		      [20, 118, 65, 152]
      Period		      "10"
      SampleTime	      "1/4000"
      Port {
	PortNumber		1
	Name			"冲激脉冲"
	TestPoint		off
	LinearAnalysisOutput	off
	LinearAnalysisInput	off
	RTWStorageClass		"Auto"
	DataLogging		off
	DataLoggingNameMode	"SignalName"
	DataLoggingDecimateData	off
	DataLoggingDecimation	"2"
	DataLoggingLimitDataPoints off
	DataLoggingMaxPoints	"5000"
      }
    }
    Block {
      BlockType		      RandomNumber
      Name		      "Random\nNumber"
      Position		      [25, 50, 55, 80]
      SampleTime	      "1/4000"
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [2]
      Position		      [600, 267, 635, 318]
      Location		      [29, 336, 376, 665]
      Open		      on
      NumInputPorts	      "2"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
	axes2			"%<SignalLabel>"
      }
      List {
	ListType		SelectedSignals
	axes1			""
	axes2			""
      }
      TimeRange		      "0.1"
      YMin		      "-0.8~-0.08"
      YMax		      "0.8~0.08"
      DataFormat	      "StructureWithTime"
      LimitDataPoints	      off
    }
    Block {
      BlockType		      Reference
      Name		      "Spectrum\nScope"
      Ports		      [1]
      Position		      [600, 15, 635, 65]
      FontSize		      10
      SourceBlock	      "dspsnks4/Spectrum\nScope"
      SourceType	      "Spectrum Scope"
      ScopeProperties	      off
      Domain		      "Frequency"
      HorizSpan		      "1"
      UseBuffer		      on
      BufferSize	      "2048"
      Overlap		      "64"
      inpFftLenInherit	      on
      FFTlength		      "1024"
      numAvg		      "2"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      on
      AxisLegend	      off
      AxisZoom		      off
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "get(0,'defaultfigureposition')"
      AxisProperties	      on
      XUnits		      "Hertz"
      XRange		      "[0...Fs/2]"
      InheritXIncr	      on
      XIncr		      "1.0"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-20"
      YMax		      "20"
      YLabel		      "Magnitude, dB"
      LineProperties	      off
    }
    Block {
      BlockType		      Reference
      Name		      "Spectrum\nScope1"
      Ports		      [1]
      Position		      [600, 185, 635, 235]
      FontSize		      10
      SourceBlock	      "dspsnks4/Spectrum\nScope"
      SourceType	      "Spectrum Scope"
      ScopeProperties	      off
      Domain		      "Frequency"
      HorizSpan		      "1"
      UseBuffer		      on
      BufferSize	      "2048"
      Overlap		      "64"
      inpFftLenInherit	      on
      FFTlength		      "1024"
      numAvg		      "2"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      on
      AxisLegend	      off
      AxisZoom		      off
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "get(0,'defaultfigureposition')"
      AxisProperties	      on
      XUnits		      "Hertz"
      XRange		      "[0...Fs/2]"
      InheritXIncr	      on
      XIncr		      "1.0"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-40"
      YMax		      "0"
      YLabel		      "Magnitude, dB"
      LineProperties	      off
    }
    Block {
      BlockType		      Reference
      Name		      "Spectrum\nScope2"
      Ports		      [1]
      Position		      [600, 105, 635, 155]
      FontSize		      10
      SourceBlock	      "dspsnks4/Spectrum\nScope"
      SourceType	      "Spectrum Scope"
      ScopeProperties	      off
      Domain		      "Frequency"
      HorizSpan		      "1"
      UseBuffer		      on
      BufferSize	      "2048"
      Overlap		      "64"
      inpFftLenInherit	      on
      FFTlength		      "1024"
      numAvg		      "2"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      on
      AxisLegend	      off
      AxisZoom		      off
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "get(0,'defaultfigureposition')"
      AxisProperties	      on
      XUnits		      "Hertz"
      XRange		      "[0...Fs/2]"
      InheritXIncr	      on
      XIncr		      "1.0"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-40"
      YMax		      "0"
      YLabel		      "Magnitude, dB"
      LineProperties	      off
    }
    Block {
      BlockType		      ZeroOrderHold
      Name		      "Zero-Order\nHold"
      Position		      [515, 21, 550, 59]
      SampleTime	      "1/4000"
    }
    Block {
      BlockType		      ZeroOrderHold
      Name		      "Zero-Order\nHold1"
      Position		      [520, 191, 555, 229]
      SampleTime	      "1/4000"
    }
    Block {
      BlockType		      ZeroOrderHold
      Name		      "Zero-Order\nHold2"
      Position		      [515, 111, 550, 149]
      SampleTime	      "1/4000"
    }
    Line {
      SrcBlock		      "Analog\nFilter Design1"
      SrcPort		      1
      Points		      [0, 0; 45, 0]
      Branch {
	Points			[0, 55]
	DstBlock		"Product\n采样"
	DstPort			1
      }
      Branch {
	Labels			[1, 0]
	Points			[0, -25; 295, 0]
	Branch {
	  DstBlock		  "Zero-Order\nHold"
	  DstPort		  1
	}
	Branch {
	  DstBlock		  "Mux"
	  DstPort		  1
	}
      }
    }
    Line {
      Name		      "冲激脉冲"
      Labels		      [0, 0]
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      DstBlock		      "Product\n采样"
      DstPort		      2
    }
    Line {
      Name		      "恢复"
      Labels		      [0, 0]
      SrcBlock		      "Analog\nFilter Design"
      SrcPort		      1
      Points		      [0, 0; 30, 0]
      Branch {
	Labels			[1, 0]
	DstBlock		"Zero-Order\nHold2"
	DstPort			1
      }
      Branch {
	Points			[0, 175]
	DstBlock		"Scope"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "Zero-Order\nHold"
      SrcPort		      1
      DstBlock		      "Spectrum\nScope"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Zero-Order\nHold1"
      SrcPort		      1
      DstBlock		      "Spectrum\nScope1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Zero-Order\nHold2"
      SrcPort		      1
      DstBlock		      "Spectrum\nScope2"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Random\nNumber"
      SrcPort		      1
      DstBlock		      "Analog\nFilter Design1"
      DstPort		      1
    }
    Line {
      Name		      "采样输出"
      Labels		      [0, 0]
      SrcBlock		      "Product\n采样"
      SrcPort		      1
      Points		      [0, 0; 55, 0]
      Branch {
	DstBlock		"Analog\nFilter Design"
	DstPort			1
      }
      Branch {
	Points			[0, 80; 145, 0]
	Branch {
	  DstBlock		  "Zero-Order\nHold1"
	  DstPort		  1
	}
	Branch {
	  Points		  [0, 80]
	  DstBlock		  "Mux"
	  DstPort		  2
	}
      }
    }
    Line {
      Name		      "原信号和采样"
      Labels		      [0, 0]
      SrcBlock		      "Mux"
      SrcPort		      1
      DstBlock		      "Scope"
      DstPort		      1
    }
    Annotation {
      Name		      "低通"
      Position		      [375, 196]
    }
    Annotation {
      Name		      "采样定理的原理仿真\n文件名:ch6example1.mdl"
      Position		      [122, 276]
      DropShadow	      on
    }
  }
}

⌨️ 快捷键说明

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