qpsk.mdl

来自「QPSK的扩频调制解调的simulink仿真」· MDL 代码 · 共 1,224 行 · 第 1/3 页

MDL
1,224
字号
      BlockType		      Display
      Name		      "Display"
      Ports		      [1]
      Position		      [115, 480, 285, 565]
      Orientation	      "down"
      NamePlacement	      "alternate"
      Format		      "long"
      Decimation	      "1"
    }
    Block {
      BlockType		      Reference
      Name		      "Error Rate\nCalculation"
      Ports		      [2, 1]
      Position		      [205, 287, 265, 323]
      Orientation	      "left"
      SourceBlock	      "commsink2/Error Rate\nCalculation"
      SourceType	      "Error Rate Calculation"
      N			      "0"
      st_delay		      "0"
      cp_mode		      "Entire frame"
      subframe		      "[]"
      PMode		      "Port"
      WsName		      "ErrorVec"
      RsMode2		      off
      stop		      off
      numErr		      "100"
      maxBits		      "1e6"
    }
    Block {
      BlockType		      Reference
      Name		      "Integer to Bit\nConverter"
      Ports		      [1, 1]
      Position		      [670, 298, 750, 342]
      Orientation	      "left"
      SourceBlock	      "commutil2/Integer to Bit\nConverter"
      SourceType	      "Integer to Bit Converter"
      nbits		      "2"
    }
    Block {
      BlockType		      Reference
      Name		      "PN Sequence\nGenerator"
      Ports		      [0, 1]
      Position		      [35, 208, 115, 252]
      SourceBlock	      "commseqgen2/PN Sequence\nGenerator"
      SourceType	      "PN Sequence Generator"
      poly		      "[1 0 1 1 1 0 0 0 1]"
      ini_sta		      "[0 0 0 0 0 0 0 1 ]"
      shift		      "0"
      Ts		      "1/255"
      frameBased	      off
      sampPerFrame	      "1"
      reset		      off
    }
    Block {
      BlockType		      Product
      Name		      "Product"
      Ports		      [2, 1]
      Position		      [445, 141, 475, 174]
      InputSameDT	      off
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
    }
    Block {
      BlockType		      Product
      Name		      "Product1"
      Ports		      [2, 1]
      Position		      [475, 297, 505, 328]
      Orientation	      "left"
      InputSameDT	      off
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
    }
    Block {
      BlockType		      Reference
      Name		      "Random Integer\nGenerator"
      Ports		      [0, 1]
      Position		      [35, 128, 115, 172]
      FontName		      "Arial"
      SourceBlock	      "commrandsrc2/Random Integer\nGenerator"
      SourceType	      "Random Integer Generator"
      ShowPortLabels	      on
      mul		      "2"
      seed		      "12345"
      Ts		      "1"
      frameBased	      off
      sampPerFrame	      "1"
      orient		      off
    }
    Block {
      BlockType		      Scope
      Name		      "Scope"
      Ports		      [4]
      Position		      [525, 93, 555, 127]
      Location		      [5, 47, 1029, 741]
      Open		      off
      NumInputPorts	      "4"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"inital data"
	axes2			"converter to bipolar"
	axes3			"PN data 255"
	axes4			"spread signal"
      }
      YMin		      "-1~-2~-2~-2"
      YMax		      "2~2~2~2"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Scope
      Name		      "Scope1"
      Ports		      [1]
      Position		      [685, 73, 715, 107]
      Location		      [5, 47, 1029, 741]
      Open		      off
      NumInputPorts	      "1"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      SaveName		      "ScopeData1"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Scope
      Name		      "Scope2"
      Ports		      [5]
      Position		      [670, 405, 700, 465]
      Location		      [5, 47, 1029, 741]
      Open		      off
      NumInputPorts	      "5"
      ZoomMode		      "xonly"
      List {
	ListType		AxesTitles
	axes1			"QPSK demodulated data"
	axes2			"converter to Bipolar"
	axes3			"PN data"
	axes4			"spread signal"
	axes5			"inital signal"
      }
      YMin		      "-2~-2~-2~-2~-2"
      YMax		      "2~2~2~2~2"
      SaveName		      "ScopeData2"
      DataFormat	      "StructureWithTime"
    }
    Block {
      BlockType		      Reference
      Name		      "Spectrum\nScope"
      Ports		      [1]
      Position		      [100, 380, 150, 415]
      Orientation	      "down"
      SourceBlock	      "dspsnks4/Spectrum\nScope"
      SourceType	      "Spectrum Scope"
      ShowPortLabels	      off
      ScopeProperties	      on
      Domain		      "Frequency"
      HorizSpan		      "1"
      UseBuffer		      on
      BufferSize	      "512"
      Overlap		      "256"
      inpFftLenInherit	      on
      FFTlength		      "512"
      numAvg		      "4"
      DisplayProperties	      off
      AxisGrid		      on
      Memory		      off
      FrameNumber	      on
      AxisLegend	      off
      AxisZoom		      off
      OpenScopeAtSimStart     on
      OpenScopeImmediately    off
      FigPos		      "get(0,'defaultfigureposition')"
      AxisProperties	      off
      XUnits		      "Hertz"
      XRange		      "[-Fs/2...Fs/2]"
      InheritXIncr	      off
      XIncr		      "1/1275"
      XLabel		      "Samples"
      YUnits		      "dB"
      YMin		      "-30"
      YMax		      "10"
      YLabel		      "Magnitude, dB"
      LineProperties	      off
    }
    Block {
      BlockType		      ZeroOrderHold
      Name		      "Zero-Order\nHold"
      Position		      [110, 285, 140, 320]
      Orientation	      "down"
      SampleTime	      "1/75"
    }
    Line {
      SrcBlock		      "DQPSK\nModulator\nBaseband"
      SrcPort		      1
      Points		      [30, 0]
      DstBlock		      "AWGN\nChannel"
      DstPort		      1
    }
    Line {
      SrcBlock		      "AWGN\nChannel"
      SrcPort		      1
      Points		      [0, 40]
      Branch {
	DstBlock		"Discrete-Time\nEye Diagram\nScope1"
	DstPort			1
      }
      Branch {
	DstBlock		"DQPSK\nDemodulator\nBaseband"
	DstPort			1
      }
      Branch {
	DstBlock		"Discrete-Time\nSignal Trajectory\nScope1"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Product"
      SrcPort		      1
      Points		      [0, 0; 15, 0]
      Branch {
	Points			[0, -35]
	DstBlock		"Scope"
	DstPort			4
      }
      Branch {
	DstBlock		"5"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "1"
      SrcPort		      1
      Points		      [0, 0; 20, 0]
      Branch {
	DstBlock		"Product"
	DstPort			1
      }
      Branch {
	Points			[0, -45]
	DstBlock		"Scope"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "PN Sequence\nGenerator"
      SrcPort		      1
      Points		      [0, 0; 5, 0]
      Branch {
	DstBlock		"Zero-Order\nHold"
	DstPort			1
      }
      Branch {
	DstBlock		"2"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "2"
      SrcPort		      1
      Points		      [0, 0; 65, 0]
      Branch {
	Points			[0, -65]
	Branch {
	  DstBlock		  "Product"
	  DstPort		  2
	}
	Branch {
	  Points		  [0, -50]
	  DstBlock		  "Scope"
	  DstPort		  3
	}
      }
      Branch {
	Points			[135, 0; 0, 75]
	Branch {
	  Points		  [0, 130]
	  DstBlock		  "Scope2"
	  DstPort		  3
	}
	Branch {
	  DstBlock		  "Product1"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "5"
      SrcPort		      1
      Points		      [0, 0; 15, 0]
      Branch {
	Points			[0, -70]
	DstBlock		"Scope1"
	DstPort			1
      }
      Branch {
	DstBlock		"Bit to Integer\nConverter"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Zero-Order\nHold"
      SrcPort		      1
      DstBlock		      "Spectrum\nScope"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Bit to Integer\nConverter"
      SrcPort		      1
      DstBlock		      "DQPSK\nModulator\nBaseband"
      DstPort		      1
    }
    Line {
      SrcBlock		      "DQPSK\nDemodulator\nBaseband"
      SrcPort		      1
      DstBlock		      "Integer to Bit\nConverter"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Integer to Bit\nConverter"
      SrcPort		      1
      Points		      [0, 0; -20, 0]
      Branch {
	Points			[-30, 0]
	DstBlock		"6"
	DstPort			1
      }
      Branch {
	Points			[0, 95]
	DstBlock		"Scope2"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "6"
      SrcPort		      1
      Points		      [0, 0]
      Branch {
	Points			[0, 0; 0, 105]
	DstBlock		"Scope2"
	DstPort			2
      }
      Branch {
	DstBlock		"Product1"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "Random Integer\nGenerator"
      SrcPort		      1
      Points		      [0, 0; 70, 0]
      Branch {
	Points			[0, 0; 0, -55]
	DstBlock		"Scope"
	DstPort			1
      }
      Branch {
	DstBlock		"1"
	DstPort			1
      }
      Branch {
	Points			[0, 305; 100, 0]
	Branch {
	  DstBlock		  "Scope2"
	  DstPort		  5
	}
	Branch {
	  Points		  [0, -160]
	  DstBlock		  "Error Rate\nCalculation"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "3"
      SrcPort		      1
      DstBlock		      "Error Rate\nCalculation"
      DstPort		      2
    }
    Line {
      SrcBlock		      "4"
      SrcPort		      1
      DstBlock		      "3"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Product1"
      SrcPort		      1
      Points		      [0, 0; -5, 0]
      Branch {
	DstBlock		"4"
	DstPort			1
      }
      Branch {
	Points			[0, 130]
	DstBlock		"Scope2"
	DstPort			4
      }
    }
    Line {
      SrcBlock		      "Error Rate\nCalculation"
      SrcPort		      1
      DstBlock		      "Display"
      DstPort		      1
    }
  }
}

⌨️ 快捷键说明

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