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

📄 dds_n256.mdl

📁 用MATLAB中的SIMULINK工具实现DDS的仿真模型
💻 MDL
📖 第 1 页 / 共 3 页
字号:
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      Product
      Inputs		      "2"
      Multiplication	      "Element-wise(.*)"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Zero"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      RelationalOperator
      Operator		      ">="
      InputSameDT	      on
      LogicOutDataTypeMode    "Logical (see Configuration Parameters: Optimiza"
"tion)"
      LogicDataType	      "uint(8)"
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Rounding
      Operator		      "floor"
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Scope
      Floating		      off
      ModelBased	      off
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      Grid		      "on"
      TimeRange		      "auto"
      YMin		      "-5"
      YMax		      "5"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      LimitDataPoints	      on
      MaxDataPoints	      "5000"
      Decimation	      "1"
      SampleInput	      off
      SampleTime	      "0"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      SFunctionModules	      "''"
      PortCounts	      "[]"
    }
    Block {
      BlockType		      StateSpace
      A			      "1"
      B			      "1"
      C			      "1"
      D			      "1"
      X0		      "0"
      AbsoluteTolerance	      "auto"
      Realization	      "auto"
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      PermitHierarchicalResolution "All"
      SystemSampleTime	      "-1"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      Sum
      IconShape		      "rectangular"
      Inputs		      "++"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      ToWorkspace
      VariableName	      "simulink_output"
      MaxDataPoints	      "1000"
      Decimation	      "1"
      SampleTime	      "0"
      FixptAsFi		      off
    }
    Block {
      BlockType		      TriggerPort
      TriggerType	      "rising"
      StatesWhenEnabling      "inherit"
      ShowOutputPort	      off
      OutputDataType	      "auto"
      SampleTimeType	      "triggered"
      SampleTime	      "1"
      ZeroCross		      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		    "dds_n256"
    Location		    [190, 351, 823, 637]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "A4"
    PaperUnits		    "centimeters"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      Reference
      Name		      "Analog\nFilter Design"
      Ports		      [1, 1]
      Position		      [240, 82, 305, 138]
      SourceBlock	      "dsparch4/Analog\nFilter Design"
      SourceType	      "Analog Filter Design"
      method		      "Butterworth"
      filttype		      "Lowpass"
      N			      "4"
      Wlo		      "15*RF*K/16777216"
      Whi		      "RF*8/16"
      Rp		      "2"
      Rs		      "40"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Calculate  \nfrequency\n"
      Ports		      [1, 1]
      Position		      [350, 176, 390, 214]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"Calculate  \nfrequency\n"
	Location		[517, 386, 867, 618]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [30, 28, 60, 42]
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  Constant
	  Name			  "Constant1"
	  Position		  [25, 100, 55, 130]
	  Value			  "0"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Frequency of\nsingle tone"
	  Ports			  [1, 1]
	  Position		  [165, 153, 270, 207]
	  ShowName		  off
	  TreatAsAtomicUnit	  off
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  MaskDisplay		  "disp('Single Tone\\nFrequency Estimator');"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	  System {
	    Name		    "Frequency of\nsingle tone"
	    Location		    [181, 209, 446, 413]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "A4"
	    PaperUnits		    "centimeters"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "In1"
	      Position		      [110, 25, 140, 40]
	      Orientation	      "down"
	      Port		      "1"
	      IconDisplay	      "Port number"
	      LatchInput	      off
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "Calculate single tone \nfrequency"
	      Ports		      [1, 1, 0, 1]
	      Position		      [90, 73, 165, 127]
	      TreatAsAtomicUnit	      on
	      MinAlgLoopOccurrences   off
	      RTWSystemCode	      "Auto"
	      System {
		Name			"Calculate single tone \nfrequency"
		Location		[99, 524, 780, 705]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"A4"
		PaperUnits		"centimeters"
		ZoomFactor		"100"
		Block {
		  BlockType		  Inport
		  Name			  "Time"
		  Position		  [40, 63, 70, 77]
		  Port			  "1"
		  IconDisplay		  "Port number"
		  LatchInput		  off
		  Port {
		    PortNumber		    1
		    Name		    "Time of current edge"
		    RTWStorageClass	    "Auto"
		    DataLoggingNameMode	    "SignalName"
		    ShowSigGenPortName	    on
		  }
		}
		Block {
		  BlockType		  TriggerPort
		  Name			  "Trigger"
		  Ports			  []
		  Position		  [75, 110, 95, 130]
		  ZeroCross		  off
		}
		Block {
		  BlockType		  Constant
		  Name			  "Constant"
		  Position		  [270, 110, 300, 140]
		  ShowName		  off
		  Value			  "0"
		}
		Block {
		  BlockType		  Memory
		  Name			  "Memory"
		  Position		  [125, 55, 155, 85]
		  InheritSampleTime	  on
		  Port {
		    PortNumber		    1
		    Name		    "Time of previous edge"
		    RTWStorageClass	    "Auto"
		    DataLoggingNameMode	    "SignalName"
		    ShowSigGenPortName	    on
		  }
		}
		Block {
		  BlockType		  Product
		  Name			  "Product"
		  Ports			  [1, 1]
		  Position		  [375, 24, 405, 56]
		  ShowName		  off
		  Inputs		  "/"
		  RndMeth		  "Floor"
		  Port {
		    PortNumber		    1
		    Name		    "Frequency"
		    RTWStorageClass	    "Auto"
		    DataLoggingNameMode	    "SignalName"
		    ShowSigGenPortName	    on
		  }
		}
		Block {
		  BlockType		  RelationalOperator
		  Name			  "Relational\nOperator"
		  Position		  [365, 102, 395, 133]
		  ShowName		  off
		  Operator		  "~="
		  Port {
		    PortNumber		    1
		    Name		    "Gating signal"
		    RTWStorageClass	    "Auto"
		    DataLoggingNameMode	    "SignalName"
		    ShowSigGenPortName	    on
		  }
		}
		Block {
		  BlockType		  Product
		  Name			  "Set to Zero\nif previous time\nwas "
"zero"
		  Ports			  [2, 1]
		  Position		  [535, 32, 565, 63]
		  RndMeth		  "Floor"
		}
		Block {
		  BlockType		  Sum
		  Name			  "Sum"
		  Ports			  [2, 1]
		  Position		  [305, 30, 325, 50]
		  ShowName		  off
		  IconShape		  "round"
		  Inputs		  "|+-"
		  Port {
		    PortNumber		    1
		    Name		    "Period"
		    RTWStorageClass	    "Auto"
		    DataLoggingNameMode	    "SignalName"
		    ShowSigGenPortName	    on
		  }
		}
		Block {
		  BlockType		  Outport
		  Name			  "Freq"
		  Position		  [615, 43, 645, 57]
		  IconDisplay		  "Port number"
		  BusOutputAsStruct	  off
		  InitialOutput		  "0"
		}
		Line {
		  Name			  "Gating signal"
		  Labels		  [2, 0]
		  SrcBlock		  "Relational\nOperator"
		  SrcPort		  1
		  Points		  [55, 0; 0, -65]
		  DstBlock		  "Set to Zero\nif previous time\nwas "
"zero"
		  DstPort		  2
		}
		Line {
		  SrcBlock		  "Constant"
		  SrcPort		  1
		  DstBlock		  "Relational\nOperator"
		  DstPort		  2
		}
		Line {
		  SrcBlock		  "Set to Zero\nif previous time\nwas "
"zero"
		  SrcPort		  1
		  DstBlock		  "Freq"
		  DstPort		  1
		}
		Line {
		  Name			  "Time of previous edge"
		  Labels		  [1, 1]
		  SrcBlock		  "Memory"
		  SrcPort		  1
		  Points		  [155, 0]
		  Branch {
		    Points		    [0, 40]
		    DstBlock		    "Relational\nOperator"
		    DstPort		    1
		  }
		  Branch {
		    DstBlock		    "Sum"
		    DstPort		    2
		  }
		}
		Line {
		  Name			  "Frequency"
		  Labels		  [1, 0]
		  SrcBlock		  "Product"
		  SrcPort		  1
		  DstBlock		  "Set to Zero\nif previous time\nwas "
"zero"
		  DstPort		  1
		}
		Line {
		  Name			  "Period"
		  Labels		  [-1, 1]
		  SrcBlock		  "Sum"
		  SrcPort		  1
		  DstBlock		  "Product"
		  DstPort		  1
		}
		Line {
		  Name			  "Time of current edge"
		  SrcBlock		  "Time"
		  SrcPort		  1
		  Points		  [35, 0]
		  Branch {
		    DstBlock		    "Memory"
		    DstPort		    1
		  }
		  Branch {
		    Labels		    [2, 0]
		    Points		    [0, -30]
		    DstBlock		    "Sum"
		    DstPort		    1
		  }
		}
		Annotation {
		  Name			  "Ensure frequency calculation\nonly "
"for full period"
		  Position		  [507, 151]
		}
	      }
	    }
	    Block {
	      BlockType		      Clock
	      Name		      "Clock"
	      Position		      [25, 90, 45, 110]
	      Decimation	      "1"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [190, 93, 220, 107]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "Calculate single tone \nfrequency"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Clock"
	      SrcPort		      1
	      DstBlock		      "Calculate single tone \nfrequency"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      DstBlock		      "Calculate single tone \nfrequency"
	      DstPort		      trigger
	    }
	  }
	}
	Block {
	  BlockType		  RelationalOperator
	  Name			  "Relational\nOperator"
	  Position		  [95, 27, 125, 58]
	  Operator		  ">"
	  LogicDataType		  "double"
	  ZeroCross		  off
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [295, 173, 325, 187]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "Constant1"
	  SrcPort		  1
	  Points		  [0, -65]
	  DstBlock		  "Relational\nOperator"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Relational\nOperator"
	  SrcPort		  1
	  Points		  [20, 0]
	  DstBlock		  "Frequency of\nsingle tone"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Relational\nOperator"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Frequency of\nsingle tone"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Constant
      Name		      "Control\nWord"
      Position		      [20, 110, 50, 140]
      Value		      "K"

⌨️ 快捷键说明

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