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

📄 dds_n256.mdl

📁 用MATLAB中的SIMULINK工具实现DDS的仿真模型
💻 MDL
📖 第 1 页 / 共 3 页
字号:
    }
    Block {
      BlockType		      SubSystem
      Name		      "Phase\nAccumulator"
      Ports		      [2, 1]
      Position		      [90, 80, 130, 140]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"Phase\nAccumulator"
	Location		[32, 149, 432, 398]
	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, 88, 55, 102]
	  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		    [2, 74, 1014, 744]
	    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, 33, 135, 47]
	      Port		      "1"
	      IconDisplay	      "Port number"
	      LatchInput	      off
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant1"
	      Position		      [55, 145, 85, 175]
	      Value		      "2"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant2"
	      Position		      [210, 135, 240, 165]
	      Value		      "2"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant3"
	      Position		      [50, 200, 80, 230]
	      Value		      "24"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant4"
	      Position		      [215, 185, 245, 215]
	      Value		      "16"
	    }
	    Block {
	      BlockType		      Product
	      Name		      "Divide1"
	      Ports		      [2, 1]
	      Position		      [385, 77, 415, 108]
	      Inputs		      "*/"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutScaling	      "2^-10"
	      RndMeth		      "Floor"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Math
	      Name		      "Math\nFunction"
	      Ports		      [2, 1]
	      Position		      [195, 32, 225, 63]
	      Operator		      "mod"
	      OutputSignalType	      "real"
	    }
	    Block {
	      BlockType		      Math
	      Name		      "Math\nFunction1"
	      Ports		      [2, 1]
	      Position		      [135, 152, 165, 183]
	      Operator		      "pow"
	      OutputSignalType	      "real"
	    }
	    Block {
	      BlockType		      Math
	      Name		      "Math\nFunction2"
	      Ports		      [2, 1]
	      Position		      [290, 142, 320, 173]
	      Operator		      "pow"
	      OutputSignalType	      "real"
	    }
	    Block {
	      BlockType		      Rounding
	      Name		      "Rounding\nFunction"
	      Position		      [470, 80, 500, 110]
	      Operator		      "round"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [575, 88, 605, 102]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "In1"
	      SrcPort		      1
	      DstBlock		      "Math\nFunction"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Constant1"
	      SrcPort		      1
	      DstBlock		      "Math\nFunction1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Constant3"
	      SrcPort		      1
	      Points		      [5, 0; 0, -40]
	      DstBlock		      "Math\nFunction1"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Math\nFunction1"
	      SrcPort		      1
	      Points		      [5, 0; 0, -115]
	      DstBlock		      "Math\nFunction"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Math\nFunction2"
	      SrcPort		      1
	      Points		      [30, 0; 0, -60]
	      DstBlock		      "Divide1"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Constant2"
	      SrcPort		      1
	      DstBlock		      "Math\nFunction2"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Constant4"
	      SrcPort		      1
	      Points		      [25, 0]
	      DstBlock		      "Math\nFunction2"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Math\nFunction"
	      SrcPort		      1
	      Points		      [70, 0; 0, 35]
	      DstBlock		      "Divide1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Divide1"
	      SrcPort		      1
	      DstBlock		      "Rounding\nFunction"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Rounding\nFunction"
	      SrcPort		      1
	      DstBlock		      "Out1"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [300, 88, 330, 102]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	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		      [365, 65, 395, 95]
      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		      [15, 48, 60, 82]
      PulseType		      "Time based"
      Period		      "1/RF"
      PulseWidth	      "50"
    }
    Block {
      BlockType		      Reference
      Name		      "RAM\nTable\n256"
      Ports		      [1, 1]
      Position		      [160, 82, 215, 138]
      SourceBlock	      "simulink/Lookup\nTables/Direct Lookup\nTable (n"
"-D)"
      SourceType	      "LookupNDDirect"
      maskTabDims	      "1"
      explicitNumDims	      "1"
      outDims		      "Element"
      tabIsInput	      off
      mxTable		      "[0 0.0123    0.0368    0.0613    0.0858    0.11"
"02    0.1346    0.1589    0.1830    0.2071    0.2311    0.2549    0.2785    0"
".3020    0.3253    0.3484    0.3713      0.3940    0.4164    0.4386    0.4605"
"    0.4822    0.5035    0.5246    0.5453      0.5657    0.5858    0.6055    0"
".6249    0.6438    0.6624    0.6806    0.6984      0.7157    0.7327    0.7491"
"    0.7652    0.7807    0.7958    0.8105    0.8246      0.8382    0.8514    0"
".8640    0.8761    0.8876    0.8987    0.9092    0.9191      0.9285    0.9373"
"    0.9456    0.9533    0.9604    0.9670    0.9729    0.9783      0.9831    0"
".9873    0.9909    0.9939    0.9963    0.9981    0.9993    0.9999      0.9999"
"    0.9993    0.9981    0.9963    0.9939    0.9909    0.9873    0.9831      0"
".9783    0.9729    0.9670    0.9604    0.9533    0.9456    0.9373    0.9285  "
"    0.9191    0.9092    0.8987    0.8876    0.8761    0.8640    0.8514    0.8"
"382    0.8246    0.8105    0.7958    0.7807    0.7652    0.7491    0.7327    "
"0.7157       0.6984    0.6806    0.6624    0.6438    0.6249    0.6055    0.58"
"58    0.5657       0.5453    0.5246    0.5035    0.4822    0.4605    0.4386  "
"  0.4164    0.3940        0.3713    0.3484    0.3253    0.3020    0.2785    0"
".2549    0.2311    0.2071     0.1830    0.1589    0.1346    0.1102    0.0858 "
"   0.0613    0.0368    0.0123    -0.0123   -0.0368   -0.0613   -0.0858   -0.1"
"102   -0.1346   -0.1589   -0.1830     -0.2071   -0.2311   -0.2549   -0.2785  "
" -0.3020   -0.3253   -0.3484   -0.3713     -0.3940   -0.4164   -0.4386   -0.4"
"605   -0.4822   -0.5035   -0.5246   -0.5453     -0.5657   -0.5858   -0.6055  "
" -0.6249   -0.6438   -0.6624   -0.6806   -0.6984      -0.7157   -0.7327   -0."
"7491   -0.7652   -0.7807   -0.7958   -0.8105   -0.8246     -0.8382   -0.8514 "
"  -0.8640   -0.8761   -0.8876   -0.8987   -0.9092   -0.9191     -0.9285   -0."
"9373   -0.9456   -0.9533   -0.9604   -0.9670   -0.9729   -0.9783    -0.9831  "
" -0.9873   -0.9909   -0.9939   -0.9963   -0.9981   -0.9993   -0.9999     -0.9"
"999   -0.9993   -0.9981   -0.9963   -0.9939   -0.9909   -0.9873   -0.9831    "
"   -0.9783   -0.9729   -0.9670   -0.9604   -0.9533   -0.9456   -0.9373   -0.9"
"285     -0.9191   -0.9092   -0.8987   -0.8876   -0.8761   -0.8640   -0.8514  "
" -0.8382     -0.8246   -0.8105   -0.7958   -0.7807   -0.7652   -0.7491   -0.7"
"327   -0.7157    -0.6984   -0.6806   -0.6624   -0.6438   -0.6249   -0.6055   "
"-0.5858   -0.5657      -0.5453   -0.5246   -0.5035   -0.4822   -0.4605   -0.4"
"386   -0.4164   -0.3940      -0.3713   -0.3484   -0.3253   -0.3020   -0.2785 "
"  -0.2549   -0.2311   -0.2071      -0.1830   -0.1589   -0.1346   -0.1102   -0"
".0858   -0.0613   -0.0368   -0.0123]"
      clipFlag		      "Warning"
    }
    Block {
      BlockType		      Scope
      Name		      "Synthedized Wave"
      Ports		      [1]
      Position		      [365, 14, 395, 46]
      Location		      [32, 421, 983, 608]
      Open		      off
      NumInputPorts	      "1"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      YMin		      "-1"
      YMax		      "1"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Scope
      Name		      "Synthedized Wave1"
      Ports		      [1]
      Position		      [195, 14, 225, 46]
      Location		      [31, 190, 982, 389]
      Open		      off
      NumInputPorts	      "1"
      ZoomMode		      "yonly"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      YMin		      "-68812.8"
      YMax		      "-62259.2"
      SaveName		      "ScopeData1"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Display
      Name		      "Synthesized Frequency\nin Hz"
      Ports		      [1]
      Position		      [410, 180, 500, 210]
      Decimation	      "1"
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace"
      Position		      [355, 125, 415, 155]
      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		      "Calculate  \nfrequency\n"
      SrcPort		      1
      DstBlock		      "Synthesized Frequency\nin Hz"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      Points		      [5, 0; 0, 30]
      DstBlock		      "Phase\nAccumulator"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Control\nWord"
      SrcPort		      1
      DstBlock		      "Phase\nAccumulator"
      DstPort		      2
    }
    Line {
      SrcBlock		      "RAM\nTable\n256"
      SrcPort		      1
      DstBlock		      "Analog\nFilter Design"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Phase\nAccumulator"
      SrcPort		      1
      Points		      [5, 0]
      Branch {
	DstBlock		"RAM\nTable\n256"
	DstPort			1
      }
      Branch {
	Points			[0, -80]
	DstBlock		"Synthedized Wave1"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Analog\nFilter Design"
      SrcPort		      1
      Points		      [0, 0; 20, 0]
      Branch {
	Points			[0, -30]
	Branch {
	  Points		  [0, -50]
	  DstBlock		  "Synthedized Wave"
	  DstPort		  1
	}
	Branch {
	  DstBlock		  "Power Spectral\nDensity"
	  DstPort		  1
	}
      }
      Branch {
	Points			[0, 30]
	Branch {
	  DstBlock		  "To Workspace"
	  DstPort		  1
	}
	Branch {
	  Points		  [0, 55]
	  DstBlock		  "Calculate  \nfrequency\n"
	  DstPort		  1
	}
      }
    }
  }
}

⌨️ 快捷键说明

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