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

📄 pllsim.mdl

📁 基于锁相环Top-down的建模方法在MATLAB环境下建立数字锁相环完整的仿真模型
💻 MDL
📖 第 1 页 / 共 3 页
字号:
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      n			      "N"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Frequency of\nsingle tone"
      Ports		      [1, 1]
      Position		      [600, 338, 705, 392]
      ShowName		      off
      FontName		      "Helvetica"
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      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		"usletter"
	PaperUnits		"inches"
	TiledPaperMargins	[0.196850, 0.196850, 0.196850, 0.196850]
	TiledPageScale		1
	ShowPageBoundaries	off
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [110, 25, 140, 40]
	  Orientation		  "down"
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Calculate single tone \nfrequency"
	  Ports			  [1, 1, 0, 1]
	  Position		  [90, 73, 165, 127]
	  TreatAsAtomicUnit	  on
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  FunctionWithSeparateData off
	  MaskHideContents	  off
	  System {
	    Name		    "Calculate single tone \nfrequency"
	    Location		    [99, 524, 780, 705]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "usletter"
	    PaperUnits		    "inches"
	    TiledPaperMargins	    [0.196850, 0.196850, 0.196850, 0.196850]
	    TiledPageScale	    1
	    ShowPageBoundaries	    off
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "Time"
	      Position		      [40, 63, 70, 77]
	      IconDisplay	      "Port number"
	      Port {
		PortNumber		1
		Name			"Time of current edge"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    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"
	      }
	    }
	    Block {
	      BlockType		      Product
	      Name		      "Product"
	      Ports		      [1, 1]
	      Position		      [375, 24, 405, 56]
	      ShowName		      off
	      Inputs		      "/"
	      CollapseMode	      "All dimensions"
	      RndMeth		      "Floor"
	      Port {
		PortNumber		1
		Name			"Frequency"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      RelationalOperator
	      Name		      "Relational\nOperator"
	      Position		      [365, 102, 395, 133]
	      ShowName		      off
	      Operator		      "~="
	      Port {
		PortNumber		1
		Name			"Gating signal"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Product
	      Name		      "Set to Zero\nif previous time\nwas zero"
	      Ports		      [2, 1]
	      Position		      [535, 32, 565, 63]
	      CollapseMode	      "All dimensions"
	      RndMeth		      "Floor"
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum"
	      Ports		      [2, 1]
	      Position		      [305, 30, 325, 50]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|+-"
	      CollapseMode	      "All dimensions"
	      Port {
		PortNumber		1
		Name			"Period"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    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		      Gain
      Name		      "Gain"
      Position		      [530, 205, 560, 235]
      FontName		      "Helvetica"
      Gain		      "(fr*N/M-fq)*2/sen"
    }
    Block {
      BlockType		      Logic
      Name		      "Phase\nDetector"
      Ports		      [2, 1]
      Position		      [365, 202, 395, 233]
      FontName		      "Helvetica"
      Operator		      "XOR"
    }
    Block {
      BlockType		      DiscretePulseGenerator
      Name		      "Pulse\nGenerator"
      Ports		      [0, 1]
      Position		      [120, 195, 150, 225]
      FontName		      "Helvetica"
      PulseType		      "Time based"
      Period		      "1/fr"
      PulseWidth	      "50"
    }
    Block {
      BlockType		      Scope
      Name		      "Reference\nSignal"
      Ports		      [1]
      Position		      [265, 269, 295, 301]
      FontName		      "Helvetica"
      Floating		      off
      Location		      [681, 60, 1005, 300]
      Open		      on
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      TimeRange		      "1e-007"
      YMin		      "-1"
      YMax		      "2"
      DataFormat	      "StructureWithTime"
      SampleTime	      "0"
    }
    Block {
      BlockType		      Scope
      Name		      "Synthesized\nSignal"
      Ports		      [1]
      Position		      [865, 204, 895, 236]
      FontName		      "Helvetica"
      Floating		      off
      Location		      [349, 59, 673, 300]
      Open		      on
      NumInputPorts	      "1"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      TimeRange		      "5e-008"
      YMin		      "-1"
      YMax		      "2"
      SaveName		      "ScopeData2"
      DataFormat	      "StructureWithTime"
      MaxDataPoints	      "50000"
      SampleTime	      "0"
    }
    Block {
      BlockType		      Display
      Name		      "Synthesized Frequency\nin Hz"
      Ports		      [1]
      Position		      [740, 350, 830, 380]
      FontName		      "Helvetica"
      Decimation	      "1"
      Lockdown		      off
    }
    Block {
      BlockType		      Reference
      Name		      "Voltage-Controlled\nOscillator"
      Ports		      [1, 1]
      Position		      [610, 198, 675, 242]
      ShowName		      off
      FontName		      "Helvetica"
      SourceBlock	      "commsynccomp2/Continuous-Time\nVCO"
      SourceType	      "Continuous-Time VCO"
      ShowPortLabels	      "FromPortIcon"
      SystemSampleTime	      "-1"
      FunctionWithSeparateData off
      RTWMemSecFuncInitTerm   "Inherit from model"
      RTWMemSecFuncExecute    "Inherit from model"
      RTWMemSecDataConstants  "Inherit from model"
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      Ac		      "1"
      Fc		      "fq"
      Kc		      "sen"
      Ph		      "0"
    }
    Line {
      SrcBlock		      "Pulse\nGenerator"
      SrcPort		      1
      Points		      [30, 0]
      Branch {
	Points			[0, 75]
	DstBlock		"Reference\nSignal"
	DstPort			1
      }
      Branch {
	DstBlock		"Frequency Divider"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Phase\nDetector"
      SrcPort		      1
      DstBlock		      "Analog\nFilter Design"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Gain"
      SrcPort		      1
      Points		      [15, 0]
      Branch {
	DstBlock		"Voltage-Controlled\nOscillator"
	DstPort			1
      }
      Branch {
	Points			[0, 50]
	DstBlock		"Control\nSignal"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Voltage-Controlled\nOscillator"
      SrcPort		      1
      DstBlock		      "Convert to\nSquare Wave"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Convert to\nSquare Wave"
      SrcPort		      1
      Points		      [25, 0]
      Branch {
	DstBlock		"Synthesized\nSignal"
	DstPort			1
      }
      Branch {
	Points			[0, 100; -215, 0]
	Branch {
	  DstBlock		  "Frequency Divider1"
	  DstPort		  1
	}
	Branch {
	  Points		  [0, 45]
	  DstBlock		  "Frequency of\nsingle tone"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "Frequency Divider"
      SrcPort		      1
      DstBlock		      "Phase\nDetector"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Frequency Divider1"
      SrcPort		      1
      Points		      [-60, 0]
      DstBlock		      "Phase\nDetector"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Analog\nFilter Design"
      SrcPort		      1
      DstBlock		      "Gain"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Frequency of\nsingle tone"
      SrcPort		      1
      DstBlock		      "Synthesized Frequency\nin Hz"
      DstPort		      1
    }
    Annotation {
      Name		      "Phase Locked Loop   "
      Position		      [521, 101]
      FontName		      "Arial"
      FontSize		      20
      FontWeight	      "bold"
    }
  }
}

⌨️ 快捷键说明

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