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

📄 dds_n.mdl

📁 用MATLAB中的SIMULINK工具实现DDS的仿真模型
💻 MDL
📖 第 1 页 / 共 3 页
字号:
	    }
	    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		      SubSystem
      Name		      "PHASE \nACCUMULATOR"
      Ports		      [2, 1]
      Position		      [185, 140, 225, 200]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"PHASE \nACCUMULATOR"
	Location		[32, 149, 387, 301]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [115, 25, 145, 40]
	  Orientation		  "down"
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  Inport
	  Name			  "In2"
	  Position		  [25, 90, 55, 104]
	  Port			  "2"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Triggered\nSubsystem"
	  Ports			  [1, 1, 0, 1]
	  Position		  [80, 74, 180, 116]
	  TreatAsAtomicUnit	  on
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  System {
	    Name		    "Triggered\nSubsystem"
	    Location		    [353, 328, 855, 680]
	    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, 103, 140, 117]
	      Port		      "1"
	      IconDisplay	      "Port number"
	      LatchInput	      off
	    }
	    Block {
	      BlockType		      TriggerPort
	      Name		      "Trigger"
	      Ports		      []
	      Position		      [225, 20, 245, 40]
	      StatesWhenEnabling      "held"
	    }
	    Block {
	      BlockType		      "S-Function"
	      Name		      "S-Function"
	      Ports		      [1, 1]
	      Position		      [225, 95, 285, 125]
	      FunctionName	      "addcontrolk"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [360, 103, 390, 117]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      DstBlock		      "S-Function"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "S-Function"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "period\nSubsystem"
	  Ports			  [1, 1]
	  Position		  [235, 65, 275, 125]
	  TreatAsAtomicUnit	  off
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  System {
	    Name		    "period\nSubsystem"
	    Location		    [565, 162, 835, 312]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "A4"
	    PaperUnits		    "centimeters"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "In1"
	      Position		      [105, 28, 135, 42]
	      Port		      "1"
	      IconDisplay	      "Port number"
	      LatchInput	      off
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant2"
	      Position		      [25, 95, 55, 125]
	      Value		      "16"
	    }
	    Block {
	      BlockType		      Math
	      Name		      "Math\nFunction"
	      Ports		      [2, 1]
	      Position		      [160, 27, 190, 58]
	      Operator		      "mod"
	      OutputSignalType	      "real"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [215, 38, 245, 52]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "Constant2"
	      SrcPort		      1
	      Points		      [40, 0; 0, -60]
	      DstBlock		      "Math\nFunction"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      DstBlock		      "Math\nFunction"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Math\nFunction"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [300, 90, 330, 104]
	  IconDisplay		  "Port number"
	}
	Line {
	  SrcBlock		  "Triggered\nSubsystem"
	  SrcPort		  1
	  DstBlock		  "period\nSubsystem"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Triggered\nSubsystem"
	  DstPort		  trigger
	}
	Line {
	  SrcBlock		  "In2"
	  SrcPort		  1
	  DstBlock		  "Triggered\nSubsystem"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "period\nSubsystem"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Reference
      Name		      "Power Spectral\nDensity"
      Ports		      [1]
      Position		      [670, 220, 700, 250]
      SourceBlock	      "simulink_extras/Additional\nSinks/Power Spectra"
"l\nDensity"
      SourceType	      "Power Spectral Density"
      ShowPortLabels	      on
      npts		      "256"
      fftpts		      "512"
      HowOften		      "128"
      sampleT		      "0.1/RF"
    }
    Block {
      BlockType		      DiscretePulseGenerator
      Name		      "Pulse\nGenerator"
      Ports		      [0, 1]
      Position		      [50, 43, 95, 77]
      PulseType		      "Time based"
      Period		      "1/RF"
      PulseWidth	      "50"
    }
    Block {
      BlockType		      Reference
      Name		      "RAM\nTable"
      Ports		      [1, 1]
      Position		      [255, 142, 310, 198]
      SourceBlock	      "simulink/Lookup\nTables/Direct Lookup\nTable (n"
"-D)"
      SourceType	      "LookupNDDirect"
      maskTabDims	      "1"
      explicitNumDims	      "1"
      outDims		      "Element"
      tabIsInput	      off
      mxTable		      "[0.1951 0.5556 0.8315 0.9808 0.9808 0.8315 0.55"
"56 0.1951 -0.1951 -0.5556 -0.8315 -0.9808 -0.9808 -0.8315 -0.5556 -0.1951]"
      clipFlag		      "Warning"
    }
    Block {
      BlockType		      RelationalOperator
      Name		      "Relational\nOperator"
      Position		      [610, 337, 640, 368]
      Operator		      ">"
      LogicDataType	      "double"
      ZeroCross		      off
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [1]
      Position		      [625, 154, 655, 186]
      Location		      [31, 190, 982, 389]
      Open		      off
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      YMin		      "-1"
      YMax		      "1"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Scope
      Name		      "Scope1"
      Ports		      [1]
      Position		      [715, 339, 745, 371]
      Location		      [38, 262, 696, 517]
      Open		      off
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      YMin		      "-1"
      YMax		      "1"
      SaveName		      "ScopeData1"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Reference
      Name		      "Spectrum\nAnalyzer"
      Ports		      [2]
      Position		      [585, 87, 615, 118]
      SourceBlock	      "simulink_extras/Additional\nSinks/Spectrum\nAna"
"lyzer"
      SourceType	      "Spectrum Analyzer"
      ShowPortLabels	      on
      npts		      "256"
      fftpts		      "256"
      HowOften		      "64"
      sampleT		      "1/RF"
    }
    Block {
      BlockType		      Display
      Name		      "Synthesized Frequency\nin Hz"
      Ports		      [1]
      Position		      [825, 485, 915, 515]
      Decimation	      "1"
    }
    Block {
      BlockType		      Display
      Name		      "Synthesized Frequency\nin Hz1"
      Ports		      [1]
      Position		      [440, 30, 530, 60]
      Decimation	      "1"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace"
      Position		      [670, 280, 730, 310]
      VariableName	      "simout"
      MaxDataPoints	      "inf"
      SampleTime	      "-1"
      SaveFormat	      "Array"
      FixptAsFi		      on
    }
    Block {
      BlockType		      Clock
      Name		      "Clock1"
      Position		      [220, 445, 240, 465]
      IOType		      "siggen"
      Decimation	      "10"
    }
    Line {
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      Points		      [0, 0; 60, 0]
      Branch {
	Points			[85, 0]
	Branch {
	  Points		  [25, 0]
	  DstBlock		  "Frequency of\nsingle tone1"
	  DstPort		  1
	}
	Branch {
	  Points		  [0, 35]
	  DstBlock		  "Spectrum\nAnalyzer"
	  DstPort		  1
	}
      }
      Branch {
	Points			[0, 95]
	DstBlock		"PHASE \nACCUMULATOR"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "CONTROL \nWORD"
      SrcPort		      1
      DstBlock		      "PHASE \nACCUMULATOR"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Analog\nFilter Design"
      SrcPort		      1
      Points		      [125, 0; 35, 0]
      Branch {
	Points			[0, -60]
	DstBlock		"Spectrum\nAnalyzer"
	DstPort			2
      }
      Branch {
	DstBlock		"Scope"
	DstPort			1
      }
      Branch {
	Points			[0, 65]
	Branch {
	  DstBlock		  "Power Spectral\nDensity"
	  DstPort		  1
	}
	Branch {
	  Points		  [0, 60]
	  Branch {
	    Points		    [0, 50]
	    DstBlock		    "Relational\nOperator"
	    DstPort		    1
	  }
	  Branch {
	    DstBlock		    "To Workspace"
	    DstPort		    1
	  }
	}
      }
    }
    Line {
      SrcBlock		      "Constant1"
      SrcPort		      1
      Points		      [0, -65]
      DstBlock		      "Relational\nOperator"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Frequency of\nsingle tone1"
      SrcPort		      1
      DstBlock		      "Synthesized Frequency\nin Hz1"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Frequency of\nsingle tone"
      SrcPort		      1
      Points		      [0, 5]
      DstBlock		      "Synthesized Frequency\nin Hz"
      DstPort		      1
    }
    Line {
      SrcBlock		      "RAM\nTable"
      SrcPort		      1
      DstBlock		      "Analog\nFilter Design"
      DstPort		      1
    }
    Line {
      SrcBlock		      "PHASE \nACCUMULATOR"
      SrcPort		      1
      DstBlock		      "RAM\nTable"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Relational\nOperator"
      SrcPort		      1
      Points		      [0, 0; 20, 0]
      Branch {
	Points			[0, 0]
	DstBlock		"Scope1"
	DstPort			1
      }
      Branch {
	DstBlock		"Frequency of\nsingle tone"
	DstPort			1
      }
    }
  }
}

⌨️ 快捷键说明

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