⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sd2.mdl

📁 SDT modulator implementation woith simulnik
💻 MDL
📖 第 1 页 / 共 2 页
字号:
Model {
  Name			  "sd2"
  Version		  2.20
  SimParamPage		  Solver
  SampleTimeColors	  off
  InvariantConstants	  off
  WideVectorLines	  off
  ShowLineWidths	  off
  StartTime		  "0.0"
  StopTime		  "6e-3"
  Solver		  FixedStepDiscrete
  RelTol		  "1e-3"
  AbsTol		  "1e-3"
  Refine		  "1"
  MaxStep		  "3.90625e-06"
  InitialStep		  "auto"
  FixedStep		  "Ts"
  MaxOrder		  5
  OutputOption		  RefineOutputTimes
  OutputTimes		  "[]"
  LoadExternalInput	  off
  ExternalInput		  "[t, u]"
  SaveTime		  off
  TimeSaveName		  "tout"
  SaveState		  off
  StateSaveName		  "xout"
  SaveOutput		  off
  OutputSaveName	  "yout"
  LoadInitialState	  off
  InitialState		  "xInitial"
  SaveFinalState	  off
  FinalStateName	  "xFinal"
  LimitMaxRows		  off
  MaxRows		  "1000"
  Decimation		  "1"
  AlgebraicLoopMsg	  warning
  MinStepSizeMsg	  warning
  UnconnectedInputMsg	  warning
  UnconnectedOutputMsg	  warning
  UnconnectedLineMsg	  warning
  ConsistencyChecking	  off
  ZeroCross		  on
  SimulationMode	  normal
  RTWSystemTargetFile	  "grt.tlc"
  RTWInlineParameters	  off
  RTWPlaceOutputsASAP	  off
  RTWRetainRTWFile	  off
  RTWTemplateMakefile	  "grt.tmf"
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  CloseFcn		  ";slview('closediagram',bdroot);"
  BlockDefaults {
    Orientation		    right
    ForegroundColor	    black
    BackgroundColor	    white
    DropShadow		    off
    NamePlacement	    normal
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    normal
    FontAngle		    normal
    ShowName		    on
  }
  AnnotationDefaults {
    HorizontalAlignment	    center
    VerticalAlignment	    middle
    ForegroundColor	    black
    BackgroundColor	    white
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    normal
    FontAngle		    normal
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    normal
    FontAngle		    normal
  }
  System {
    Name		    "sd2"
    Location		    [24, 219, 762, 597]
    Open		    on
    ToolBar		    on
    StatusBar		    on
    ScreenColor		    white
    PaperOrientation	    landscape
    PaperPositionMode	    auto
    PaperType		    usletter
    PaperUnits		    inches
    Block {
      BlockType		      SubSystem
      Name		      "IDEAL \nIntegrator"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [470, 182, 525, 218]
      ShowPortLabels	      on
      MaskType		      "Integrator"
      MaskDescription	      "Real discrete integrator with delay.\nModels op"
"-amp saturation and slew rate."
      MaskHelp		      "Parameters:\nTs:       Sample time\nG:         "
"Finite op-amp gain (ideal op-amp G=1)\nAmax:  Saturation value\nsr:       sle"
"w rate in V/s"
      MaskPromptString	      "Saturation|Sample Time:"
      MaskStyleString	      "edit,edit"
      MaskTunableValueString  "on,on"
      MaskVariables	      "Amax=@1;Ts=@2;"
      MaskDisplay	      "dpoly([0 1], [1 -1], 'z-')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "Amax|Ts"
      System {
	Name			"IDEAL \nIntegrator"
	Location		[140, 94, 718, 341]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "IN"
	  Position		  [110, 35, 130, 55]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Saturate
	  Name			  "Saturation"
	  Position		  [285, 35, 325, 65]
	  UpperLimit		  "Amax"
	  LowerLimit		  "-Amax"
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [180, 38, 205, 62]
	  Inputs		  "++"
	}
	Block {
	  BlockType		  UnitDelay
	  Name			  "Unit Delay"
	  Position		  [230, 35, 260, 65]
	  X0			  "0"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [365, 41, 385, 59]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  "Sum"
	  SrcPort		  1
	  DstBlock		  "Unit Delay"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "IN"
	  SrcPort		  1
	  DstBlock		  "Sum"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Unit Delay"
	  SrcPort		  1
	  DstBlock		  "Saturation"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Saturation"
	  SrcPort		  1
	  Points		  [5, 0]
	  Branch {
	    DstBlock		    "Out1"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 55; -185, 0; 0, -50]
	    DstBlock		    "Sum"
	    DstPort		    2
	  }
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "NoiseInt1"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [180, 235, 230, 265]
      ShowName		      off
      ShowPortLabels	      on
      MaskType		      "OpAmp Noise"
      MaskPromptString	      "Random Number Seed:|Sample Time:|Op-amp Noise S"
"td. Dev.:"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskVariables	      "seed=@1;Ts=@2;noise=@3;"
      MaskDisplay	      "disp('OpNoise')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "sum(clock)^1/111|Ts|noise1"
      System {
	Name			"NoiseInt1"
	Location		[236, 346, 661, 541]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "C"
	  Position		  [35, 25, 55, 45]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Gain
	  Name			  "Gain"
	  Position		  [190, 90, 220, 120]
	  Gain			  "noise"
	}
	Block {
	  BlockType		  Product
	  Name			  "Product"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [285, 42, 315, 73]
	  Inputs		  "2"
	}
	Block {
	  BlockType		  RandomNumber
	  Name			  "Random\nNumber"
	  Position		  [35, 90, 65, 120]
	  Mean			  "0"
	  Variance		  "1"
	  Seed			  "seed"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  ZeroOrderHold
	  Name			  "Zero-Order\nHold"
	  Position		  [115, 90, 145, 120]
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Outport
	  Name			  "N"
	  Position		  [345, 53, 375, 67]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Random\nNumber"
	  SrcPort		  1
	  DstBlock		  "Zero-Order\nHold"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Zero-Order\nHold"
	  SrcPort		  1
	  DstBlock		  "Gain"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Product"
	  SrcPort		  1
	  DstBlock		  "N"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Gain"
	  SrcPort		  1
	  Points		  [45, 0]
	  DstBlock		  "Product"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "C"
	  SrcPort		  1
	  Points		  [210, 0]
	  DstBlock		  "Product"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "REAL\nIntegrator"
      Ports		      [1, 1, 0, 0, 0]
      Position		      [300, 177, 355, 213]
      ShowPortLabels	      on
      MaskType		      "Integrator"
      MaskDescription	      "Real discrete integrator with delay.\nModels op"
"-amp saturation and slew rate."
      MaskHelp		      "Parameters:\nTs:       Sample time\nG:         "
"Finite op-amp gain (ideal op-amp G=1)\nAmax:  Saturation value\nsr:       sle"
"w rate in V/s"
      MaskPromptString	      "Sample Time:|Finite Gain:|Saturation:|Slew Rate"
":|Gain-Bandwidth"
      MaskStyleString	      "edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on"
      MaskVariables	      "Ts=@1;alfa=@2;Amax=@3;sr=@4;GBW=@5;"
      MaskDisplay	      "dpoly([0 1], [1 -1], 'z-')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "Ts|alfa|Amax|sr|GBW"
      System {
	Name			"REAL\nIntegrator"
	Location		[72, 141, 650, 388]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "IN"
	  Position		  [15, 35, 35, 55]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Saturate
	  Name			  "Saturation"
	  Position		  [360, 35, 390, 65]
	  UpperLimit		  "Amax"
	  LowerLimit		  "-Amax"
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [180, 38, 205, 62]
	  Inputs		  "++"
	}
	Block {
	  BlockType		  UnitDelay
	  Name			  "Unit Delay"
	  Position		  [260, 35, 290, 65]
	  X0			  "0"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Gain
	  Name			  "alfa"
	  Position		  [290, 120, 320, 150]
	  Orientation		  left
	  Gain			  "alfa"
	}
	Block {
	  BlockType		  MATLABFcn
	  Name			  "slewRate"
	  Position		  [70, 30, 130, 60]
	  MATLABFcn		  "slew(u,alfa,sr,GBW,Ts)"
	  OutputWidth		  "-1"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [505, 41, 525, 59]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "[]"
	}
	Line {
	  SrcBlock		  "Sum"
	  SrcPort		  1
	  DstBlock		  "Unit Delay"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Unit Delay"
	  SrcPort		  1
	  DstBlock		  "Saturation"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Saturation"
	  SrcPort		  1
	  Points		  [45, 0]
	  Branch {
	    DstBlock		    "Out1"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 85]
	    DstBlock		    "alfa"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "IN"
	  SrcPort		  1
	  DstBlock		  "slewRate"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "slewRate"
	  SrcPort		  1
	  DstBlock		  "Sum"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "alfa"
	  SrcPort		  1
	  Points		  [-130, 0; 0, -80]
	  DstBlock		  "Sum"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      Relay
      Name		      "Relay"
      Position		      [565, 185, 595, 215]
      OnSwitchValue	      "eps"
      OffSwitchValue	      "-eps"
      OnOutputValue	      "Vref"
      OffOutputValue	      "-Vref"
    }
    Block {
      BlockType		      SubSystem
      Name		      "SC1"
      Ports		      [2, 1, 0, 0, 0]
      Position		      [79, 130, 126, 170]
      Orientation	      down
      NamePlacement	      alternate
      ShowName		      off
      ShowPortLabels	      on
      MaskType		      "kT/C Noise"
      MaskDescription	      "Models the kT/Cs noise of a switched capacitanc"
"e Cs.\nIN input: the input signal line\nC input:   accepts the coefficient WI"
"TH SIGN (Cs/Ci)"
      MaskHelp		      "Block parameters:\nTs:        Sample time\nCi: "
"       Integrating Capacitance\nTemp:   Absolute Temperature in Kelvin\nk:   "
"      Boltzmann Constant\nseed:    Initial seed for random number generator\n"
"Outputs the noisy signal.\n"
      MaskPromptString	      "Sample Time:|Integrating Capacitance:|Absolute "
"Temperature:|Boltzman Constant:|Random Number Seed:"
      MaskStyleString	      "edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on"
      MaskVariables	      "Ts=@1;Ci=@2;Temp=@3;k=@4;seed=@5;"
      MaskDisplay	      "disp('kT/C')\n\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      none
      MaskIconUnits	      autoscale
      MaskValueString	      "Ts|Cf|Temp|k|sum(clock)"
      System {
	Name			"SC1"
	Location		[181, 74, 792, 430]
	Open			off
	ToolBar			off
	StatusBar		off
	ScreenColor		white
	PaperOrientation	landscape
	PaperPositionMode	auto
	PaperType		usletter
	PaperUnits		inches
	Block {
	  BlockType		  Inport
	  Name			  "C"
	  Position		  [15, 20, 35, 40]
	  Port			  "1"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Inport
	  Name			  "IN"
	  Position		  [335, 80, 355, 100]
	  Port			  "2"
	  PortWidth		  "-1"
	  SampleTime		  "-1"
	}
	Block {
	  BlockType		  Product
	  Name			  "Product"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [310, 137, 340, 168]
	  Inputs		  "2"
	}
	Block {
	  BlockType		  Product
	  Name			  "Product2"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [465, 77, 495, 108]
	  Inputs		  "2"
	}
	Block {
	  BlockType		  RandomNumber
	  Name			  "Random\nNumber"
	  Position		  [130, 145, 160, 175]
	  Mean			  "0"
	  Variance		  "1"
	  Seed			  "seed"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1, 0, 0, 0]
	  Position		  [390, 82, 420, 113]
	  Inputs		  "++"
	}
	Block {
	  BlockType		  ZeroOrderHold
	  Name			  "Zero-Order\nHold"
	  Position		  [210, 145, 240, 175]
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Fcn
	  Name			  "kT/C noise"
	  Position		  [170, 15, 230, 45]
	  Expr			  "sqrt((k*Temp/Ci)/abs(u))"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Y"
	  Position		  [525, 85, 545, 105]
	  Port			  "1"
	  OutputWhenDisabled	  held
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Random\nNumber"
	  SrcPort		  1
	  DstBlock		  "Zero-Order\nHold"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "C"
	  SrcPort		  1
	  Points		  [95, 0]
	  Branch {
	    Points		    [0, 35; 315, 0]
	    DstBlock		    "Product2"
	    DstPort		    1
	  }
	  Branch {
	    DstBlock		    "kT/C noise"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Zero-Order\nHold"
	  SrcPort		  1
	  DstBlock		  "Product"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "kT/C noise"
	  SrcPort		  1

⌨️ 快捷键说明

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