lhw_stbc_x3c.mdl

来自「用simlink开发的space-time coding仿真模型,仿真的精度与效」· MDL 代码 · 共 2,278 行 · 第 1/5 页

MDL
2,278
字号
	  BackgroundColor	  "lightBlue"
	  TreatAsAtomicUnit	  off
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  System {
	    Name		    "h3"
	    Location		    [189, 286, 669, 523]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "A4"
	    PaperUnits		    "centimeters"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Reference
	      Name		      "Complex\nExponential"
	      Ports		      [1, 1]
	      Position		      [150, 107, 200, 143]
	      SourceBlock	      "dspmathops/Complex\nExponential"
	      SourceType	      "Complex Exponential"
	      ShowPortLabels	      "on"
	    }
	    Block {
	      BlockType		      Product
	      Name		      "Product"
	      Ports		      [2, 1]
	      Position		      [270, 62, 300, 93]
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Reference
	      Name		      "Rayleigh Noise\nGenerator"
	      Ports		      [0, 1]
	      Position		      [125, 28, 205, 72]
	      FontSize		      10
	      SourceBlock	      "commnoisgen2/Rayleigh Noise\nGenerator"
	      SourceType	      "Rayleigh Noise Generator"
	      ShowPortLabels	      "on"
	      alpha		      "my_sigma"
	      seed		      "68521"
	      Ts		      "my_sample_time"
	      frameBased	      "off"
	      sampPerFrame	      "1"
	      orient		      "off"
	    }
	    Block {
	      BlockType		      Reference
	      Name		      "Uniform Noise\nGenerator"
	      Ports		      [0, 1]
	      Position		      [25, 103, 105, 147]
	      FontSize		      10
	      SourceBlock	      "commnoisgen2/Uniform Noise\nGenerator"
	      SourceType	      "Uniform Noise Generator"
	      ShowPortLabels	      "on"
	      low		      "0"
	      up		      "2*pi"
	      seed		      "56479"
	      Ts		      "my_sample_time"
	      frameBased	      "off"
	      sampPerFrame	      "1"
	      orient		      "off"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "h3"
	      Position		      [325, 73, 355, 87]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "Uniform Noise\nGenerator"
	      SrcPort		      1
	      DstBlock		      "Complex\nExponential"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Rayleigh Noise\nGenerator"
	      SrcPort		      1
	      Points		      [20, 0; 0, 20]
	      DstBlock		      "Product"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Complex\nExponential"
	      SrcPort		      1
	      Points		      [25, 0; 0, -40]
	      DstBlock		      "Product"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Product"
	      SrcPort		      1
	      DstBlock		      "h3"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [360, 73, 390, 87]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "h1"
	  SrcPort		  1
	  DstBlock		  "Copy"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "h2"
	  SrcPort		  1
	  DstBlock		  "Copy1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "h3"
	  SrcPort		  1
	  DstBlock		  "Copy2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Copy"
	  SrcPort		  1
	  Points		  [15, 0]
	  DstBlock		  "Matrix\nConcatenation1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Copy1"
	  SrcPort		  1
	  DstBlock		  "Matrix\nConcatenation1"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Copy2"
	  SrcPort		  1
	  Points		  [15, 0]
	  DstBlock		  "Matrix\nConcatenation1"
	  DstPort		  3
	}
	Line {
	  SrcBlock		  "Matrix\nConcatenation1"
	  SrcPort		  1
	  DstBlock		  "Buffer"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Buffer"
	  SrcPort		  1
	  DstBlock		  "Tran"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Tran"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Display
      Name		      "Display3"
      Ports		      [1]
      Position		      [490, 422, 585, 488]
      FontSize		      10
      Decimation	      "1"
    }
    Block {
      BlockType		      Reference
      Name		      "Error Rate\nCalculation"
      Ports		      [2, 1]
      Position		      [423, 335, 512, 385]
      Orientation	      "down"
      NamePlacement	      "alternate"
      FontSize		      10
      SourceBlock	      "commsink2/Error Rate\nCalculation"
      SourceType	      "Error Rate Calculation"
      N			      "0"
      st_delay		      "16"
      cp_mode		      "Entire frame"
      subframe		      "[]"
      PMode		      "Port"
      WsName		      "ErrorVec"
      RsMode2		      off
      stop		      on
      numErr		      "200"
      maxBits		      "3e6"
    }
    Block {
      BlockType		      FrameConversion
      Name		      "Frame Conversion2"
      Position		      [815, 75, 860, 105]
      FontSize		      10
      OutFrame		      "Sample based"
    }
    Block {
      BlockType		      FrameConversion
      Name		      "Frame Conversion3"
      Position		      [810, 125, 855, 155]
      FontSize		      10
      OutFrame		      "Sample based"
    }
    Block {
      BlockType		      FrameConversion
      Name		      "Frame Conversion4"
      Position		      [830, 285, 875, 315]
      Orientation	      "left"
      FontSize		      10
      OutFrame		      "Frame based"
    }
    Block {
      BlockType		      Reference
      Name		      "Integer to Bit\nConverter"
      Ports		      [1, 1]
      Position		      [225, 281, 285, 319]
      FontSize		      10
      SourceBlock	      "commutil2/Integer to Bit\nConverter"
      SourceType	      "Integer to Bit Converter"
      nbits		      "2"
    }
    Block {
      BlockType		      Reference
      Name		      "Integer to Bit\nConverter1"
      Ports		      [1, 1]
      Position		      [640, 281, 700, 319]
      Orientation	      "left"
      FontSize		      10
      SourceBlock	      "commutil2/Integer to Bit\nConverter"
      SourceType	      "Integer to Bit Converter"
      nbits		      "2"
    }
    Block {
      BlockType		      Reference
      Name		      "Integer to Bit\nConverter2"
      Ports		      [1, 1]
      Position		      [105, 63, 150, 97]
      FontSize		      10
      SourceBlock	      "commutil2/Integer to Bit\nConverter"
      SourceType	      "Integer to Bit Converter"
      nbits		      "2"
    }
    Block {
      BlockType		      Reference
      Name		      "M-PSK\nModulator\nBaseband"
      Ports		      [1, 1]
      Position		      [180, 63, 230, 97]
      FontSize		      10
      SourceBlock	      "commdigbbndpm2/M-PSK\nModulator\nBaseband"
      SourceType	      "M-PSK Modulator Baseband"
      M			      "4"
      InType		      "Bit"
      Enc		      "Gray"
      Ph		      "0"
      numSamp		      "1"
    }
    Block {
      BlockType		      Math
      Name		      "Math\nFunction"
      Ports		      [1, 1]
      Position		      [755, 195, 785, 225]
      Operator		      "magnitude^2"
    }
    Block {
      BlockType		      Reference
      Name		      "Matrix\nConcatenation"
      Ports		      [3, 1]
      Position		      [350, 51, 405, 109]
      FontSize		      10
      SourceBlock	      "simulink/Math\nOperations/Matrix\nConcatenation"
      SourceType	      "Matrix Concatenation"
      numInports	      "3"
      catMethod		      "Horizontal"
    }
    Block {
      BlockType		      Reference
      Name		      "Matrix\nSum"
      Ports		      [1, 1]
      Position		      [575, 70, 640, 110]
      DialogController	      "dspDDGCreate"
      DialogControllerArgs    "DataTag0"
      FontSize		      10
      SourceBlock	      "dspmtrx3/Matrix\nSum"
      SourceType	      "Matrix Sum"
      Dim		      "Columns"
      additionalParams	      off
      allowOverrides	      on
      outputMode	      "Same as accumulator"
      outputWordLength	      "16"
      outputFracLength	      "15"
      accumMode		      "Inherit via internal rule"
      accumWordLength	      "32"
      accumFracLength	      "30"
      roundingMode	      "Floor"
      overflowMode	      off
      LockScale		      off
    }
    Block {
      BlockType		      Reference
      Name		      "Multiport\nSelector"
      Ports		      [1, 1]
      Position		      [510, 175, 565, 215]
      FontSize		      10
      SourceBlock	      "dspindex/Multiport\nSelector"
      SourceType	      "Multiport Selector"
      rowsOrCols	      "Columns"
      idxCellArray	      "{ 1 }"
      idxErrMode	      "Clip Index"
    }
    Block {
      BlockType		      Product
      Name		      "Product"
      Ports		      [2, 1]
      Position		      [515, 71, 550, 104]
      Inputs		      "**"
      InputSameDT	      off
      OutDataTypeMode	      "Inherit via internal rule"
      OutScaling	      "2^-10"
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	off
    }
    Block {
      BlockType		      "S-Function"
      Name		      "S-Function Builder"
      Ports		      [1, 3]
      Position		      [255, 51, 315, 109]
      BackgroundColor	      "lightBlue"
      CopyFcn		      "set_param(gcbh,'LinkStatus','none')"
      PreSaveFcn	      "try, set_param(gcb,'FunctionName','x_3_c'), end"
      OpenFcn		      "sfunctionwizard(gcbh)"
      FontSize		      10
      FunctionName	      "x_3_c"
      SFunctionModules	      "x_3_c_wrapper  "
      WizardData	      "DataTag1"
      MaskType		      "S-Function Builder"
      MaskInitialization      "val = [[.9  0.75 0.75 1 1 .9 .9 1]',[1 1 0.75 0"
".75 .9 .9 1 .9]'];try , sys = get_param(gcb,'SfunBuilderFcnName');if isempty("
"sys), sys = get_param(gcb,'FunctionName'); end,catch, sys = get_param(gcb,'Fu"
"nctionName'); end"
      MaskDisplay	      "plot(val(:,1),val(:,2)),disp(sys)port_label('in"
"put',1,'x')port_label('output',1,'y1')port_label('output',2,'y2')port_label('"
"output',3,'y3')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "normalized"
    }
    Block {
      BlockType		      Reference
      Name		      "Source"
      Ports		      [0, 1]
      Position		      [15, 62, 65, 98]
      FontSize		      10
      SourceBlock	      "commrandsrc2/Random Integer\nGenerator"
      SourceType	      "Random Integer Generator"
      ShowPortLabels	      on
      mul		      "4"
      seed		      "37"
      Ts		      "1e-5"
      frameBased	      on
      sampPerFrame	      "4"
      orient		      off
    }
    Block {
      BlockType		      ToWorkspace
      Name		      "To Workspace"
      Position		      [510, 530, 570, 560]
      VariableName	      "ErrorVec"
      MaxDataPoints	      "1"
      SampleTime	      "-1"
      SaveFormat	      "Array"
    }
    Block {
      BlockType		      Math
      Name		      "Transpose"
      Ports		      [1, 1]
      Position		      [430, 65, 460, 95]
      Operator		      "transpose"
    }
    Block {
      BlockType		      Math
      Name		      "Transpose1"
      Ports		      [1, 1]
      Position		      [755, 75, 785, 105]
      Operator		      "transpose"
    }
    Block {
      BlockType		      "S-Function"
      Name		      "signal determination"
      Ports		      [2, 1]
      Position		      [921, 225, 979, 285]
      Orientation	      "down"
      BackgroundColor	      "lightBlue"
      NamePlacement	      "alternate"
      CopyFcn		      "set_param(gcbh,'LinkStatus','none')"
      PreSaveFcn	      "try, set_param(gcb,'FunctionName','signal_deter"
"mination'), end"
      InitFcn		      "try, set_param(gcb,'FunctionName','signal_deter"
"mination'), end,"
      OpenFcn		      "sfunctionwizard(gcbh)"
      FontSize		      10
      FunctionName	      "signal_determination"
      SFunctionModules	      "signal_determination_wrapper  "
      WizardData	      "DataTag2"
      MaskType		      "S-Function Builder"
      MaskInitialization      "val = [[.9  0.75 0.75 1 1 .9 .9 1]',[1 1 0.75 0"
".75 .9 .9 1 .9]'];try , sys = get_param(gcb,'SfunBuilderFcnName');if isempty("
"sys), sys = get_param(gcb,'FunctionName'); end,catch, sys = get_param(gcb,'Fu"
"nctionName'); end"
      MaskDisplay	      "plot(val(:,1),val(:,2)),disp(sys)port_label('in"
"put',1,'h2')port_label('input',2,'x')port_label('output',1,'y0')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "normalized"
    }
    Block {
      BlockType		      SubSystem
      Name		      "x3h decoder\nsignal estimation"
      Ports		      [2, 1]
      Position		      [885, 67, 950, 163]
      BackgroundColor	      "lightBlue"
      FontSize		      10
      TreatAsAtomicUnit	      on
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"x3h decoder\nsignal estimation"
	Location		[2, 74, 1014, 724]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "r"
	  Position		  [15, 58, 45, 72]
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  Inport
	  Name			  "h"

⌨️ 快捷键说明

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