Library {
  Name			  "comcdint"
  Version		  4.00
  LibraryLinkDisplay	  "none"
  CovSaveName		  "covdata"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  BlockNameDataTip	  off
  BlockParametersDataTip  on
  BlockDescriptionStringDataTip	off
  ToolBar		  off
  StatusBar		  off
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  off
  Created		  "Tue Oct 20 09:14:48 1998"
  Creator		  "tdelve"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "ysong"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Wed Aug 23 09:27:33 2000"
  ModelVersionFormat	  "1.%<AutoIncrement:6>"
  ConfigurationManager	  "none"
  SimParamPage		  "Solver"
  AlgebraicLoopMsg	  "warning"
  MinStepSizeMsg	  "warning"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  SingleTaskRateTransMsg  "none"
  MultiTaskRateTransMsg	  "error"
  IntegerOverflowMsg	  "warning"
  CheckForMatrixSingularity "none"
  UnnecessaryDatatypeConvMsg "none"
  Int32ToFloatConvMsg	  "warning"
  SignalLabelMismatchMsg  "none"
  LinearizationMsg	  "none"
  VectorMatrixConversionMsg "none"
  SfunCompatibilityCheckMsg "none"
  BlockPriorityViolationMsg "warning"
  ArrayBoundsChecking	  "none"
  ConsistencyChecking	  "none"
  Profile		  off
  SimulationMode	  "normal"
  RTWRetainRTWFile	  off
  RTWMakeCommand	  "make_rtw"
  RTWGenerateCodeOnly	  off
  TLCProfiler		  off
  TLCDebug		  off
  TLCCoverage		  off
  ExtModeMexFile	  "ext_comm"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  1000
  ExtModeTrigHoldOff	  0
  ExtModeTrigDelay	  0
  ExtModeTrigDirection	  "rising"
  ExtModeTrigLevel	  0
  ExtModeArchiveMode	  "off"
  ExtModeAutoIncOneShot	  off
  ExtModeIncDirWhenArm	  off
  ExtModeAddSuffixToVar	  off
  ExtModeWriteAllDataToWs off
  ExtModeArmWhenConnect	  on
  ExtModeLogAll		  on
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "comcdint"
    Location		    [118, 58, 584, 376]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    AutoZoom		    on
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "D-S SS"
      Ports		      []
      Position		      [250, 198, 330, 242]
      BackgroundColor	      "cyan"
      ShowName		      off
      OpenFcn		      "dsss"
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskDisplay	      "disp('Direct sequence\\nspread spectrum\\ndemo'"
")"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"D-S SS"
	Location		[360, 100, 520, 245]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"cyan"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Descrambler"
      Ports		      [2, 2]
      Position		      [140, 128, 220, 172]
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskType		      "Descrambler"
      MaskDescription	      "This block outputs the descrambled signal of th"
"e 1st inport input symbol. The block input and output are controlled by the r"
"ising edge of the 2nd inport input signal. The block works only if the enable"
" signal is on. This block takes scalar input only. The second output port out"
"puts the states of the registers."
      MaskHelp		      "Scrambling is a simple method to minimize trans"
"ferring a long series of the same number, such as 1 or 0. Its operation is ba"
"sed on a scrambler polynomial g(x). This block descrambles the input signal u"
"sing the polynomial g(x). You can specify the polynomial using the coefficien"
"ts of the polynomial or by specifying the terms for which the coefficient is "
"1; for other terms, the coefficient is the default, 0. For example g = [1 0 0"
" 0 0 0 1 0 1] and g = [0 -6 -8] represent the same polynomial g(x) = 1 + x^(-"
"6) + x^(-8). The initial state of at least one of the registers must be nonze"
"ro in order to generate a nonzero sequence. The Descrambler block inherits th"
"e sample time from the block that inputs to it."
      MaskPromptString	      "Calculation base:|Scramble polynomial:|Initial "
"states"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVariables	      "M=@1;poly=@2;ini_sta=@3;"
      MaskInitialization      "if M<=0, error('Scramble calculation base must "
"be a positive interger.'); end\nif max(poly)>=M\n error('Scramble polynomial "
"coefficients must be less than calculation base.');\nelseif min(poly)<0\n  tm"
"p = zeros(1, abs(min(poly))+1);\n  for i = 1:length(poly), tmp(abs(poly(i))+1"
") = 1; end\n  poly = tmp;\nend\nif poly(1) == 0, poly(1) = 1; end\ns = length"
"(poly)-1;"
      MaskDisplay	      "disp('Descrambler')\nplot(0,0,100,100,[5 10 10 "
"8 10 12 10 10 15],[5 5 12 8 12 8 12 15 15]+10)"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "2|[0 -5 -6]|[1 1 0 1 0 1]"
      MaskVariableAliases     ",,"
      System {
	Name			"Descrambler"
	Location		[360, 100, 868, 213]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [50, 33, 80, 47]
	  ShowName		  off
	  Port			  "1"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Inport
	  Name			  "In2"
	  Position		  [25, 53, 55, 67]
	  ShowName		  off
	  Port			  "2"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Demux
	  Name			  "Demux"
	  Ports			  [1, 2]
	  Position		  [330, 32, 365, 68]
	  Outputs		  "[1 s]"
	  BusSelectionMode	  off
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux"
	  Ports			  [2, 1]
	  Position		  [130, 32, 165, 68]
	  Inputs		  "2"
	  DisplayOption		  "none"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function"
	  Ports			  [1, 1]
	  Position		  [230, 35, 290, 65]
	  FunctionName		  "simscram"
	  Parameters		  "M, poly, 1, ini_sta"
	  PortCounts		  "[]"
	  SFunctionModules	  "''"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out2"
	  Position		  [425, 33, 455, 47]
	  ShowName		  off
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out3"
	  Position		  [395, 53, 425, 67]
	  ShowName		  off
	  Port			  "2"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In2"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "S-Function"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function"
	  SrcPort		  1
	  DstBlock		  "Demux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  1
	  DstBlock		  "Out2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  2
	  DstBlock		  "Out3"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Interleave"
      Ports		      [2, 1, 1]
      Position		      [30, 53, 110, 97]
      ShowPortLabels	      on
      TreatAsAtomicUnit	      on
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskType		      "Block Interleave"
      MaskDescription	      "This block takes a new symbol from the 1st inpu"
"t port and outputs an interleaved signal to the 1st output port at the rising"
" edge of the 2nd inport input signal. The block works only if the enable sign"
"al is on. This block takes scalar input only. The output is the interleaved r"
"esult."
      MaskHelp		      "Block interleaving is a simple method to conver"
"t burst errors to random errors. The block keeps an N-column by M-row buffer."
" The input to the buffer is row by row. The output from this buffer is column"
" by column. The output of this block has an N*M step delay from the starting "
"point of the input. Before a meaningful message is output, this block outputs"
" 0s. Block deinterleave uses the Block Interleave function block. Note that t"
"he column and row number assignments for block deinterleave should be the exa"
"ct reverse of block interleave. Block deinterleave works only when the enable"
" signal is on."
      MaskPromptString	      "Input code row length (N):|Interleave row numbe"
"r (M):"
      MaskStyleString	      "edit,edit"
      MaskTunableValueString  "on,on"
      MaskCallbackString      "|"
      MaskEnableString	      "on,on"
      MaskVisibilityString    "on,on"
      MaskToolTipString	      "on,on"
      MaskVariables	      "N=@1;M=@2;"
      MaskInitialization      "if N<=0, error('Row length must be a positive n"
"umber.'); end;\nif M<=0 error('Interleave row number must be a positive numbe"
"r.'); end;"
      MaskDisplay	      "disp('Block\\ninterleave')\nplot(0,0,100,100,[5"
" 10 10 8 10 12 10 10 15],[5 5 12 8 12 8 12 15 15]+10)"
      MaskIconFrame	      on
      MaskIconOpaque	      off
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "3|4"
      MaskVariableAliases     ","
      System {
	Name			"Interleave"
	Location		[360, 100, 970, 266]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [50, 33, 80, 47]
	  ShowName		  off
	  Port			  "1"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Inport
	  Name			  "In2"
	  Position		  [25, 53, 55, 67]
	  ShowName		  off
	  Port			  "2"
	  Interpolate		  on
	}
	Block {
	  BlockType		  EnablePort
	  Name			  "Enable"
	  Ports			  []
	  Position		  [495, 130, 515, 150]
	  ShowName		  off
	  StatesWhenEnabling	  "held"
	  ShowOutputPort	  off
	}
	Block {
	  BlockType		  Reference
	  Name			  "Register-shift1"
	  Ports			  [2, 2]
	  Position		  [120, 28, 200, 72]
	  ShowName		  off
	  SourceBlock		  "com_util/Register-shift"
	  SourceType		  "Register-shift"
	  shft_out		  "[N*M:-1:1]"
	  thrhld		  ".1"
	}
	Block {
	  BlockType		  Reference
	  Name			  "Register-shift2"
	  Ports			  [2, 2]
	  Position		  [140, 108, 220, 152]
	  ShowName		  off
	  SourceBlock		  "com_util/Register-shift"
	  SourceType		  "Register-shift"
	  shft_out		  "[M:-1:1]"
	  thrhld		  ".1"
	}
	Block {
	  BlockType		  Terminator
	  Name			  "Terminator"
	  Position		  [395, 55, 415, 75]
	  ShowName		  off
	}
	Block {
	  BlockType		  Terminator
	  Name			  "Terminator1"
	  Position		  [240, 110, 260, 130]
	  ShowName		  off
	}
	Block {
	  BlockType		  Reference
	  Name			  "Triggered\nbuffer down"
	  Ports			  [3, 2]
	  Position		  [280, 33, 360, 77]
	  ShowName		  off
	  SourceBlock		  "com_util/Triggered\nbuffer down"
	  SourceType		  "Triggered buffer down"
	  in_size		  "N*M"
	  ini_idx		  "[0:N-1]"
	  idx_inc		  "N*ones(1, N)"
	  thrshld		  ".1"
	  cycl_flag		  "1"
	}
	Block {
	  BlockType		  Reference
	  Name			  "Triggered\nsignal switch1"
	  Ports			  [2, 1]
	  Position		  [465, 33, 545, 77]
	  ShowName		  off
	  SourceBlock		  "com_util/Triggered\nsignal switch"
	  SourceType		  "Vector signal re-distribution"
	  sw			  "[1:N]'"
	  ke			  "-1"
	  in			  "0"
	  tt			  ".1"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out2"
	  Position		  [565, 48, 595, 62]
	  ShowName		  off
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  Points		  [5, 0]
	  Branch {
	    Points		    [0, 80]
	    DstBlock		    "Register-shift2"
	    DstPort		    1
	  }
	  Branch {
	    DstBlock		    "Register-shift1"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "In2"
	  SrcPort		  1
	  Points		  [15, 0]
	  Branch {
	    Points		    [0, 35]
	    Branch {
	      Points		      [150, 0; 0, -25]
	      DstBlock		      "Triggered\nbuffer down"
	      DstPort		      3
	    }
	    Branch {
	      Points		      [0, 45]
	      DstBlock		      "Register-shift2"
	      DstPort		      2
	    }
	  }
	  Branch {
	    DstBlock		    "Register-shift1"
	    DstPort		    2
	  }
	}
	Line {
	  SrcBlock		  "Triggered\nbuffer down"
	  SrcPort		  2
	  DstBlock		  "Terminator"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Register-shift1"
	  SrcPort		  1
	  DstBlock		  "Triggered\nbuffer down"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Register-shift1"
	  SrcPort		  2
	  Points		  [60, 0]
	  DstBlock		  "Triggered\nbuffer down"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Triggered\nsignal switch1"
	  SrcPort		  1
	  DstBlock		  "Out2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Triggered\nbuffer down"
	  SrcPort		  1
	  DstBlock		  "Triggered\nsignal switch1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Register-shift2"
	  SrcPort		  1
	  DstBlock		  "Terminator1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Register-shift2"
	  SrcPort		  2
	  Points		  [210, 0; 0, -75]
	  DstBlock		  "Triggered\nsignal switch1"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Interleave demo"
      Ports		      []
      Position		      [250, 53, 330, 97]
      BackgroundColor	      "cyan"
      ShowName		      off
      OpenFcn		      "testinterleave"
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskDisplay	      "disp('Interleave\\ndemo')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Interleave demo"
	Location		[360, 100, 520, 245]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"cyan"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Interleave demo 2"
      Ports		      []
      Position		      [360, 53, 440, 97]
      BackgroundColor	      "cyan"
      ShowName		      off
      OpenFcn		      "tstrsbch"
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskDisplay	      "disp('Interleave\\ndemo2')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Interleave demo 2"
	Location		[360, 100, 520, 245]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"cyan"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "PS sequence"
      Ports		      [1, 1]
      Position		      [30, 199, 105, 241]
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskType		      "Pseudorandom sequence generator"
      MaskDescription	      "This block outputs a sequence of pseudorandom s"
"ymbols. The rising edge of the input synchronization pulse triggers the regis"
"ter shifting in the block to update the output."
      MaskHelp		      "A pseudorandom sequence can be used for a direc"
"t sequence spread spectrum system. Its operation is based on a generator poly"
"nomial g(x).  You can specify the polynomial using the coefficients of the po"
"lynomial or by specifying the terms for which the coefficient is 1; for other"
" terms, the coefficient is the default, 0. For example g = [1 0 0 0 0 0 1 0 1"
"] and g = [0 -6 -8] represent the same polynomial g(x) = 1 + x^(-6) + x^(-8)."
" The initial state of at least one of the registers must be nonzero in order "
"to generate a nonzero sequence. "
      MaskPromptString	      "Calculation base:|Generator polynomial:|Initial"
" states"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVariables	      "M=@1;poly=@2;ini_sta=@3;"
      MaskInitialization      "if M<=0, error('Scramble calculation base must "
"be a positive interger.'); end\nif max(poly)>=M\n error('Scramble polynomial "
"coefficients must be less than calculation base.');\nelseif min(poly)<0\n  tm"
"p = zeros(1, abs(min(poly))+1);\n  for i = 1:length(poly), tmp(abs(poly(i))+1"
") = 1; end\n  poly = tmp;\nend\nif poly(1) == 0, poly(1) = 1; end\ns = length"
"(poly)-1;"
      MaskDisplay	      "disp('Pseudorandom\\nsequence\\ngenerator')\npl"
"ot(0,0,100,100,[5 10 10 8 10 12 10 10 15]-5,[5 5 12 8 12 8 12 15 15]+40)"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "2|[0 -5 -6]|[1 1 0 1 0 1]"
      MaskVariableAliases     ",,"
      System {
	Name			"PS sequence"
	Location		[360, 100, 630, 196]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [40, 53, 70, 67]
	  Port			  "1"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Ground
	  Name			  "Ground"
	  Position		  [25, 30, 45, 50]
	}
	Block {
	  BlockType		  Reference
	  Name			  "Scrambler1"
	  Ports			  [2, 2]
	  Position		  [95, 28, 175, 72]
	  SourceBlock		  "comcdint/Scrambler"
	  SourceType		  "Scrambler"
	  M			  "M"
	  poly			  "poly"
	  ini_sta		  "ini_sta"
	}
	Block {
	  BlockType		  Terminator
	  Name			  "Terminator"
	  Position		  [225, 50, 245, 70]
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [200, 33, 230, 47]
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Ground"
	  SrcPort		  1
	  DstBlock		  "Scrambler1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Scrambler1"
	  SrcPort		  2
	  DstBlock		  "Terminator"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Scrambler1"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Scrambler1"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Scramble demo"
      Ports		      []
      Position		      [250, 128, 330, 172]
      BackgroundColor	      "cyan"
      ShowName		      off
      OpenFcn		      "testscrm"
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskDisplay	      "disp('Scramble\\ndemo')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Scramble demo"
	Location		[360, 100, 520, 245]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"cyan"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Scrambler"
      Ports		      [2, 2]
      Position		      [30, 128, 110, 172]
      ShowPortLabels	      on
      TreatAsAtomicUnit	      off
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      MaskType		      "Scrambler"
      MaskDescription	      "This block outputs the scrambled signal of the "
"1st inport input symbol. The block input and output are controlled by the ris"
"ing edge of the 2nd inport input signal. This block takes scalar input only. "
"The first output port outputs the scrambled signal. The second output port ou"
"tputs the states of the registers."
      MaskHelp		      "Scrambling is a simple method to minimize trans"
"ferring a long series of the same number, such as 1 or 0. Its operation is ba"
"sed on a scrambler polynomial g(x). This block scrambles the input signal usi"
"ng the polynomial g(x). You can specify the polynomial using the coefficients"
" of the polynomial or by specifying the terms for which the coefficient is 1;"
" for other terms, the coefficient is the default, 0. For example g = [1 0 0 0"
" 0 0 1 0 1] and g = [0 -6 -8] represent the same polynomial g(x) = 1 + x^(-6)"
" + x^(-8). The initial state of at least one of the registers must be nonzero"
" in order to generate a nonzero sequence. The Scrambler block inherits the sa"
"mple time from the block that inputs to it."
      MaskPromptString	      "Calculation base:|Scramble polynomial:|Initial "
"states"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVariables	      "M=@1;poly=@2;ini_sta=@3;"
      MaskInitialization      "if M<=0, error('Scramble calculation base must "
"be a positive interger.'); end\nif max(poly)>=M\n error('Scramble polynomial "
"coefficients must be less than calculation base.');\nelseif min(poly)<0\n  tm"
"p = zeros(1, abs(min(poly))+1);\n  for i = 1:length(poly), tmp(abs(poly(i))+1"
") = 1; end\n  poly = tmp;\nend\nif poly(1) == 0, poly(1) = 1; end\ns = length"
"(poly)-1;"
      MaskDisplay	      "disp('Scrambler')\nplot(0,0,100,100,[5 10 10 8 "
"10 12 10 10 15],[5 5 12 8 12 8 12 15 15]+10)"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "2|[0 -5 -6]|[1 1 0 1 0 1]"
      MaskVariableAliases     ",,"
      System {
	Name			"Scrambler"
	Location		[360, 100, 868, 213]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	AutoZoom		on
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [50, 33, 80, 47]
	  ShowName		  off
	  Port			  "1"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Inport
	  Name			  "In2"
	  Position		  [25, 53, 55, 67]
	  ShowName		  off
	  Port			  "2"
	  Interpolate		  on
	}
	Block {
	  BlockType		  Demux
	  Name			  "Demux"
	  Ports			  [1, 2]
	  Position		  [330, 32, 365, 68]
	  Outputs		  "[1 s]"
	  BusSelectionMode	  off
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux"
	  Ports			  [2, 1]
	  Position		  [130, 32, 165, 68]
	  Inputs		  "2"
	  DisplayOption		  "none"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-Function"
	  Ports			  [1, 1]
	  Position		  [230, 35, 290, 65]
	  FunctionName		  "simscram"
	  Parameters		  "M, poly, 0, ini_sta"
	  PortCounts		  "[]"
	  SFunctionModules	  "''"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out2"
	  Position		  [425, 33, 455, 47]
	  ShowName		  off
	  Port			  "1"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out3"
	  Position		  [395, 53, 425, 67]
	  ShowName		  off
	  Port			  "2"
	  OutputWhenDisabled	  "held"
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  2
	  DstBlock		  "Out3"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Demux"
	  SrcPort		  1
	  DstBlock		  "Out2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "S-Function"
	  SrcPort		  1
	  DstBlock		  "Demux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "S-Function"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "In2"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  1
	}
      }
    }
    Line {
      SrcBlock		      "Scrambler"
      SrcPort		      1
      DstBlock		      "Descrambler"
      DstPort		      1
    }
    Annotation {
      Position		      [197, 27]
      ForegroundColor	      "red"
      Text		      "Interleave and Scrambler Library"
      FontSize		      12
      FontWeight	      "bold"
    }
    Annotation {
      Position		      [230, 297]
      Text		      "Warning: This library is obsolete and may be re"
"moved in the future."
      FontName		      "Arial"
      FontSize		      12
    }
  }
}
