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

📄 bpsnrzmf.mdl

📁 现代通信系统(Matlab版)一书的所有例子的matlab程序
💻 MDL
📖 第 1 页 / 共 5 页
字号:
	    PaperUnits		    "centimeters"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Constant
	      Name		      "Constant"
	      Position		      [140, 20, 160, 40]
	      Value		      "m"
	    }
	    Block {
	      BlockType		      StateSpace
	      Name		      "Matrix\nGain"
	      Position		      [140, 61, 165, 89]
	      A			      "[]"
	      B			      "[]"
	      C			      "[]"
	      D			      "K"
	      MaskType		      "Matrix Gain"
	      MaskDescription	      "Matrix Gain."
	      MaskHelp		      "Multiplies input vector by entered matr"
"ix to produce output vector (y=Au)."
	      MaskPromptString	      "Gain matrix:"
	      MaskStyleString	      "edit"
	      MaskTunableValueString  "on"
	      MaskEnableString	      "on"
	      MaskVisibilityString    "on"
	      MaskToolTipString	      "on"
	      MaskInitialization      "K = @1;"
	      MaskDisplay	      "disp('K')"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      MaskValueString	      "variance"
	    }
	    Block {
	      BlockType		      RandomNumber
	      Name		      "Random\nNumber"
	      Position		      [35, 57, 80, 93]
	      Seed		      "s"
	      SampleTime	      "0"
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum"
	      Ports		      [2, 1]
	      Position		      [220, 60, 240, 80]
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "out_1"
	      Position		      [285, 60, 305, 80]
	    }
	    Line {
	      SrcBlock		      "Constant"
	      SrcPort		      1
	      Points		      [25, 0; 0, 35]
	      DstBlock		      "Sum"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Sum"
	      SrcPort		      1
	      DstBlock		      "out_1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Matrix\nGain"
	      SrcPort		      1
	      DstBlock		      "Sum"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Random\nNumber"
	      SrcPort		      1
	      DstBlock		      "Matrix\nGain"
	      DstPort		      1
	    }
	  }
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1]
	  Position		  [150, 55, 170, 75]
	}
	Block {
	  BlockType		  Outport
	  Name			  "out_1"
	  Position		  [200, 55, 220, 75]
	}
	Line {
	  SrcBlock		  "Sum"
	  SrcPort		  1
	  DstBlock		  "out_1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "in_1"
	  SrcPort		  1
	  Points		  [45, 0; 0, 40]
	  DstBlock		  "Sum"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Gaussian noise\ngenerator"
	  SrcPort		  1
	  DstBlock		  "Sum"
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      Clock
      Name		      "Clock"
      Position		      [235, 150, 255, 170]
      ShowName		      off
      Decimation	      "10"
    }
    Block {
      BlockType		      Clock
      Name		      "Clock1"
      Position		      [485, 25, 505, 45]
      ShowName		      off
      Decimation	      "10"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Error rate"
      Ports		      [2]
      Position		      [890, 230, 970, 270]
      Orientation	      "down"
      CopyFcn		      "sbiterr([],[],[],'CopyBlock')"
      DeleteFcn		      "sbiterr([],[],[],'DeleteBlock')"
      LoadFcn		      "sbiterr([],[],[],'LoadBlock')"
      StartFcn		      "sbiterr([],[],[],'Start')"
      StopFcn		      "sbiterr([],[],[],'Stop')"
      NameChangeFcn	      "sbiterr([],[],[],'NameChange')"
      ShowPortLabels	      off
      TreatAsAtomicUnit	      off
      MaskType		      "Symbol/bit error counter"
      MaskDescription	      "Use the input data from the 1st port as the ref"
"erence signal to detect the number of errors and error rate of the 2nd signal"
"."
      MaskHelp		      "The signal from the first port must be a scalar"
". The second input port can be a vector with a delay to the first port signal"
". The comparison happens only at the sampling point."
      MaskPromptString	      "Bit per symbol:|Number of digits on display:|De"
"lay between 1st port and 2nd port:|Sample time (sec):"
      MaskStyleString	      "edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on"
      MaskCallbackString      "|||"
      MaskEnableString	      "on,on,on,on"
      MaskVisibilityString    "on,on,on,on"
      MaskToolTipString	      "on,on,on,on"
      MaskVarAliasString      ",,,"
      MaskInitialization      "K=@1;num_lin=@2;TDelay=@3;Sample=@4;"
      MaskDisplay	      "disp('Error\\nmeter')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "1|10|1|1"
      System {
	Name			"Error rate"
	Location		[255, 368, 509, 510]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "in_1"
	  Position		  [15, 45, 35, 65]
	}
	Block {
	  BlockType		  Inport
	  Name			  "in_2"
	  Position		  [15, 60, 35, 80]
	  Port			  "2"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux"
	  Ports			  [2, 1]
	  Position		  [65, 46, 100, 79]
	  Inputs		  "2"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-function"
	  Ports			  [1]
	  Position		  [130, 52, 195, 78]
	  FunctionName		  "sbiterr"
	  Parameters		  "num_lin, K, TDelay, Sample"
	}
	Line {
	  SrcBlock		  "in_2"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "in_1"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "S-function"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Fcn
      Name		      "Fcn"
      Position		      [525, 22, 620, 48]
      ShowName		      off
      Expr		      "2*cos(4*pi*u)"
    }
    Block {
      BlockType		      Fcn
      Name		      "Fcn1"
      Position		      [275, 145, 370, 175]
      ShowName		      off
      Expr		      "cos(4*pi*u)"
    }
    Block {
      BlockType		      "S-Function"
      Name		      "Integrate and Dump\n"
      Ports		      [1, 1]
      Position		      [720, 103, 800, 147]
      FunctionName	      "schdint"
      Parameters	      "td, ts, limit"
      MaskType		      "Scheduled reset integration"
      MaskDescription	      "Reset the state to be zero(s) at the\nscheduled"
" reset sample point."
      MaskHelp		      "This block resets the state(s) to be zero(s) at"
" the reset time points. The reset interval can be a two-element vector with t"
"he second element as offset. The computation sample time must be smaller than"
" the reset interval. The block resets the state value to be the remainder of "
"the state divided by the modulo bound when the absolute value of the state is"
" larger than the modulo bound."
      MaskPromptString	      "Scheduled reset time interval and offset (sec):"
"|Computation sample time and offset (sec):|Modulo bound:"
      MaskStyleString	      "edit,edit,edit"
      MaskTunableValueString  "on,on,on"
      MaskCallbackString      "||"
      MaskEnableString	      "on,on,on"
      MaskVisibilityString    "on,on,on"
      MaskToolTipString	      "on,on,on"
      MaskVarAliasString      ",,"
      MaskInitialization      "td=@1;ts=@2;limit=@3;"
      MaskDisplay	      "disp('Scheduled\\nreset-int')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "1|.01|999"
    }
    Block {
      BlockType		      Product
      Name		      "Product"
      Ports		      [2, 1]
      Position		      [400, 118, 430, 142]
      ShowName		      off
    }
    Block {
      BlockType		      Product
      Name		      "Product1"
      Ports		      [2, 1]
      Position		      [640, 113, 670, 137]
      ShowName		      off
    }
    Block {
      BlockType		      SubSystem
      Name		      "Source"
      Ports		      [0, 1]
      Position		      [15, 98, 45, 152]
      ShowPortLabels	      off
      TreatAsAtomicUnit	      off
      System {
	Name			"Source"
	Location		[38, 153, 317, 326]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	ZoomFactor		"100"
	Block {
	  BlockType		  Fcn
	  Name			  "Fcn"
	  Position		  [160, 75, 200, 95]
	  Expr			  "1-2*u"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Source"
	  Ports			  [0, 1]
	  Position		  [70, 63, 135, 107]
	  ShowPortLabels	  off
	  TreatAsAtomicUnit	  off
	  MaskType		  "Read from workspace"
	  MaskDescription	  "Read from a workspace variable at\nsampling"
" time point."
	  MaskHelp		  "This block reads from a workspace variable "
"at a given sample time. The column number is the block output vector length. "
"When the simulation reaches the end of the variable (eof), the block will cyc"
"lically output from the first row of the variable or output zeros based on th"
"e repeat flag entree."
	  MaskPromptString	  "Variable (column_number=block_output_length"
"):|Data output sample time (sec):|Repeat flag (1: repeat read, 0: output zero"
"s after eof).|Initial output:"
	  MaskStyleString	  "edit,edit,edit,edit"
	  MaskTunableValueString  "on,on,on,on"
	  MaskCallbackString	  "|||"
	  MaskEnableString	  "on,on,on,on"
	  MaskVisibilityString	  "on,on,on,on"
	  MaskToolTipString	  "on,on,on,on"
	  MaskVarAliasString	  ",,,"
	  MaskInitialization	  "var=@1;td=@2;ts=td(1);if (length(td)>=2),of"
"f=td(2);else off=0;end;cyc=@3;ini=@4;[x,y]=srcsicon(7);"
	  MaskDisplay		  "plot(0,0,100,100,x,y);disp('Rd wksp')"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	  MaskValueString	  "randint(1000,1,2)|1|1|1"
	  System {
	    Name		    "Source"
	    Location		    [355, 528, 737, 675]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "usletter"
	    PaperUnits		    "inches"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      "S-Function"
	      Name		      "Message source"
	      Ports		      [1, 1]
	      Position		      [180, 53, 255, 97]
	      BackgroundColor	      "yellow"
	      FunctionName	      "trigwksp"
	      Parameters	      "var,thd,cyclFlag,ini"
	      MaskType		      "Read from workspace"
	      MaskDescription	      "The raising edge of input pulse trigger"
" the block output the next row from the workspace variable."
	      MaskHelp		      "This block reads the data from a worksp"
"ace variable. The output is refreshed at the raising edge of the input pulse."
	      MaskPromptString	      "Read the variable:|Threshold for the in"
"put pulse:|Cyclic read variable (1) or amend zeros (0).|Output before first t"
"rigger:"
	      MaskStyleString	      "edit,edit,edit,edit"
	      MaskTunableValueString  "on,on,on,on"
	      MaskCallbackString      "|||"
	      MaskEnableString	      "on,on,on,on"
	      MaskVisibilityString    "on,on,on,on"
	      MaskToolTipString	      "on,on,on,on"
	      MaskVarAliasString      ",,,"
	      MaskInitialization      "var=@1;thd=@2;cyclFlag=@3;ini=@4;"
	      MaskDisplay	      "disp('Triggered\\nread')"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      MaskValueString	      "var|.1|cyc|ini"
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "Pulses deivide\nsame sample time1"
	      Ports		      [0, 1]
	      Position		      [50, 56, 110, 94]
	      ShowPortLabels	      off
	      TreatAsAtomicUnit	      off
	      MaskType		      "Pulse generator"
	      MaskDescription	      "Vector pulses with sample rate of each "
"pulse as Sample_time ./Divider. "
	      MaskHelp		      "This block generator a vector pulses. T"
"he output length is the same as the vector defined in \"Divider\". The ith el"
"ement of the output has the sample time Sample_time/Divider(i). All elements "
"in \"Divider\" must be integers."
	      MaskPromptString	      "Sample time (scalar, sec):|Divider (int"
"eger vector):|Offset (have same dimension as Divider:"
	      MaskStyleString	      "edit,edit,edit"
	      MaskTunableValueString  "on,on,on"
	      MaskCallbackString      "||"
	      MaskEnableString	      "on,on,on"
	      MaskVisibilityString    "on,on,on"
	      MaskToolTipString	      "on,on,on"
	      MaskVarAliasString      ",,"
	      MaskInitialization      "samp_time=@1;out_divid=@2;offset=@3;"
	      MaskDisplay	      "disp('Vector\\nPulse')"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      MaskValueString	      "ts|1|off"
	      System {
		Name			"Pulses deivide\nsame sample time1"
		Location		[55, 192, 283, 286]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"usletter"
		PaperUnits		"inches"
		ZoomFactor		"100"
		Block {
		  BlockType		  "S-Function"
		  Name			  "S-function1"
		  Ports			  [0, 1]
		  Position		  [40, 31, 105, 59]
		  FunctionName		  "homopuls"
		  Parameters		  "samp_time, out_divid, offset"
		}

⌨️ 快捷键说明

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