Model { Name "digcom1" Version 2.20 SimParamPage Solver SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off StartTime "0.0" StopTime "999999" Solver ode5 RelTol "1e-3" AbsTol "1e-3" Refine "1" MaxStep "dt" InitialStep "auto" FixedStep "dt" MaxOrder 5 OutputOption RefineOutputTimes OutputTimes "[]" LoadExternalInput off ExternalInput "[t, u]" SaveTime off TimeSaveName "tout" SaveState off StateSaveName "xout" SaveOutput off OutputSaveName "yout" LoadInitialState off InitialState "xInitial" SaveFinalState off FinalStateName "xFinal" LimitMaxRows off MaxRows "1000" Decimation "1" AlgebraicLoopMsg warning MinStepSizeMsg warning UnconnectedInputMsg warning UnconnectedOutputMsg warning UnconnectedLineMsg warning ConsistencyChecking off ZeroCross on SimulationMode normal RTWSystemTargetFile "grt.tlc" RTWInlineParameters off RTWPlaceOutputsASAP off RTWRetainRTWFile off RTWTemplateMakefile "grt_default_tmf" RTWMakeCommand "make_rtw" RTWGenerateCodeOnly off ExtModeMexFile "ext_comm" ExtModeBatchMode off 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 "digcom1" Location [4, 51, 835, 368] Open on ToolBar on StatusBar on ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType SubSystem Name "AWGN\nchannel" Ports [1, 1, 0, 0, 0] Position [395, 128, 475, 172] ShowPortLabels off MaskType "AWGN channel, fixed parameter" MaskDescription "Additive white Gaussian noise channel\nwith fix" "ed mean and variance." MaskHelp "This block adds white Gaussian noise to the inp" "ut signal. The mean and the variance can be a scalar or vector with the same " "length as the input signal." MaskPromptString "Mean value:|Variance (std^2):|Initial Seed:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskInitialization "m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);[x,y]=cha" "nicon;" MaskDisplay "plot(0,0,100,100,x,y);disp('AWGN')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0|1e-14|12345" System { Name "AWGN\nchannel" Location [86, 493, 348, 639] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "in_1" Position [45, 10, 65, 30] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType SubSystem Name "Gaussian\nnoise" Ports [0, 1, 0, 0, 0] Position [10, 50, 85, 90] ShowPortLabels off MaskType "Gaussian noise." MaskDescription "Gaussian distribution noise." MaskHelp "When the mean value, seed are vectors, the " "output of this block is a vector with the length of the vector same as the le" "ngth of mean value vector or that of the seed." MaskPromptString "Mean value:|Standard deviation:|Initial See" "d(s):" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskInitialization "m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);" MaskDisplay "disp('Gaussian\\nnoise')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "m|d|s" System { Name "Gaussian\nnoise" Location [409, 168, 757, 373] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Constant Name "Constant" Position [55, 55, 75, 75] Value "m" } Block { BlockType StateSpace Name "Matrix\nGain" Position [210, 81, 235, 109] A "[]" B "[]" C "[]" D "K" X0 "0" 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" MaskInitialization "K = @1;" MaskDisplay "disp('K')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "d" } Block { BlockType RandomNumber Name "Random\nNumber" Position [45, 102, 90, 138] Mean "0" Variance "1" Seed "s" SampleTime "-1" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [140, 85, 160, 105] Inputs "++" } Block { BlockType Outport Name "out_1" Position [295, 85, 315, 105] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Constant" SrcPort 1 Points [30, 0; 0, 25] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Random\nNumber" SrcPort 1 Points [15, 0; 0, -20] DstBlock "Sum" DstPort 2 } Line { SrcBlock "Sum" SrcPort 1 DstBlock "Matrix\nGain" DstPort 1 } Line { SrcBlock "Matrix\nGain" SrcPort 1 DstBlock "out_1" DstPort 1 } } } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [150, 55, 170, 75] Inputs "++" } Block { BlockType Outport Name "out_1" Position [200, 55, 220, 75] Port "1" OutputWhenDisabled held InitialOutput "0" } 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\nnoise" SrcPort 1 DstBlock "Sum" DstPort 2 } } } Block { BlockType SubSystem Name "EMNoFilter" Ports [2, 0, 0, 0, 0] Position [655, 93, 735, 137] CopyFcn "sbiterr([],[],[],'CopyBlock')" DeleteFcn "sbiterr([],[],[],'DeleteBlock')" LoadFcn "sbiterr([],[],[],'LoadBlock')" StartFcn "sbiterr([],[],[],'Start')" StopFcn "sbiterr([],[],[],'Stop')" NameChangeFcn "sbiterr([],[],[],'NameChange')" ShowPortLabels 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" 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|T/2|T" System { Name "EMNoFilter" Location [255, 368, 509, 510] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "in_1" Position [15, 45, 35, 65] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "in_2" Position [15, 60, 35, 80] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [65, 46, 100, 79] Inputs "2" } Block { BlockType "S-Function" Name "S-function" Ports [1, 0, 0, 0, 0] Position [130, 52, 195, 78] FunctionName "sbiterr" Parameters "num_lin, K, TDelay, Sample" PortCounts "[]" SFunctionModules "''" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "S-function" DstPort 1 } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Mux" DstPort 1 } Line { SrcBlock "in_2" SrcPort 1 DstBlock "Mux" DstPort 2 } } } Block { BlockType SubSystem Name "EyeDiagramNoFilter" Ports [2, 0, 0, 0, 0] Position [645, 213, 725, 257] CopyFcn "eyediasi([],[],[],'CopyBlock')" DeleteFcn "eyediasi([],[],[],'DeleteBlock')" LoadFcn "eyediasi([],[],[],'LoadBlock')" StartFcn "eyediasi([],[],[],'Start')" StopFcn "eyediasi([],[],[],'Stop')" NameChangeFcn "eyediasi([],[],[],'NameChange')" ShowPortLabels off MaskType "Eye-diagram/scatter plot" MaskDescription "Produce eye-pattern diagram/scatter\nplot/x-y p" "lot with the rising edge of the second input as the decision line." MaskHelp "This plot opens one, two, or three plots by ass" "igning the line type parameters. The scatter plot point is selected by the ri" "sing edge of a trigger signal. A decision line is drawn at the rising edge of" " the trigger signal." MaskPromptString "Eye-pattern plot time frame:|Lower and upper bo" "und of in-coming signal (1x2 vector):|Number of saved traces:|Line-type for e" "ye-pattern diagram (0 for no plot):|Line-type for scatter plot (0 for no plot" "):|Line-type for x-y plot (0 for no plot):" MaskStyleString "edit,edit,edit,edit,edit,edit" MaskTunableValueString "on,on,on,on,on,on" MaskInitialization "time_range=@1;boundary=@2;kept_length=@3;eye_li" "ne=@4;scatter_line=@5;two_d_line=@6;[x,y]=srcsicon(10);[v,w]=trigicon(0,25,ge" "t_param(gcb,'orientation'),2);" MaskDisplay "plot(0,0,100,100,x,y,v,w);" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2*T|[-2,2]|50|'r-/g--/b-.'|0|0" System { Name "EyeDiagramNoFilter" Location [165, 242, 460, 428] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "in_1" Position [15, 55, 35, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Inport Name "in_2" Position [20, 115, 40, 135] Port "2" PortWidth "-1" SampleTime "-1" } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [65, 70, 100, 105] Inputs "2" } Block { BlockType "S-Function" Name "Plot1" Ports [1, 0, 0, 0, 0] Position [130, 70, 200, 110] FunctionName "eyediasi" Parameters "time_range, boundary, kept_length, eye_line" ", scatter_line, two_d_line" PortCounts "[]" SFunctionModules "''" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Plot1" DstPort 1 } Line { SrcBlock "in_2" SrcPort 1 Points [5, 0] DstBlock "Mux" DstPort 2 } Line { SrcBlock "in_1" SrcPort 1 Points [5, 0; 0, 15] DstBlock "Mux" DstPort 1 } } } Block { BlockType Reference Name "GraphNoFilter" Ports [1, 0, 0, 0, 0] Position [685, 31, 715, 69] SourceBlock "com_sour/Graph" SourceType "Graph scope." tr "10*T" ym "-2" yma "2" color "'r-/b--/g-./k:/m*/ro/b+'" } Block { BlockType SubSystem Name "MASK demap: MF1" Ports [1, 1, 0, 0, 0] Position [525, 128, 605, 172] ShowPortLabels off MaskType "MASK demap" MaskDescription "Reverse the MASK mapping process\nConvert [-1 1" "] analog signal to [0, M-1] symbols." MaskHelp "This block demaps a MASK mapped signal back to " "digit symbols. You can place this block after a amplitude demodulation block." " The input of this block is an analog signal in the range [-1, 1]. The demodu" "lation decides the closest integer fitting in [0,M-1] range. When the input s" "ymbol interval is a two-elements vector, the second element is offset. The de" "fault offset value is 0." MaskPromptString "M-ary number (digit integers in ranger [0, M-1]" "):|Output symbol interval and offset (sec):" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskInitialization "N=@1;Ac=1;sft=[0:N-1]*Ac*2/(N-1)-Ac;td=@2;" MaskDisplay "disp('MASK\\ndemap')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2|[T, 0.9*T]" System { Name "MASK demap: MF1" Location [187, 342, 628, 482] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "in_1" Position [30, 35, 50, 55] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Abs Name "Abs" Position [235, 42, 270, 68] } Block { BlockType "S-Function" Name "Minimum" Ports [1, 1, 0, 0, 0] Position [315, 45, 370, 65] FunctionName "arymimai" Parameters "'min'" PortCounts "[]" SFunctionModules "''" } Block { BlockType Constant Name "Shift key" Position [115, 93, 135, 117] Value "sft" } Block { BlockType Sum Name "Sum2" Ports [2, 1, 0, 0, 0] Position [180, 38, 200, 67] Inputs "+-" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [85, 29, 120, 61] SampleTime "td" } Block { BlockType Outport Name "out_1" Position [400, 45, 420, 65] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Abs" SrcPort 1 DstBlock "Minimum" DstPort 1 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Sum2" DstPort 1 } Line { SrcBlock "Minimum" SrcPort 1 DstBlock "out_1" DstPort 1 } Line { SrcBlock "Shift key" SrcPort 1 Points [15, 0; 0, -45] DstBlock "Sum2" DstPort 2 } Line { SrcBlock "Sum2" SrcPort 1 DstBlock "Abs" DstPort 1 } } } Block { BlockType SubSystem Name "MASK map" Ports [1, 1, 0, 0, 0] Position [155, 128, 235, 172] ShowPortLabels off MaskType "MASK map" MaskDescription "Map a digital symbol onto an analog\nsignal in " "the range [-1, 1] using M-ary\namplitude shift keying modulation mapping." MaskHelp "This block maps an input digit signal onto a si" "gnal in the range [-1, 1]. The coded signal can be modulated using analog\\nm" "odulation blocks. Input digits are in the range [0, M-1], where M is the M-ar" "y number. The input symbol interval can be a two-element vector with the seco" "nd element being offset. The default value offset is 0. Use the MODMAP functi" "on to see the constellation." MaskPromptString "M-ary number (input integers in range [0, M-1])" ":|Input symbol interval and offset (sec):" MaskStyleString "edit,edit" MaskTunableValueString "on,on" MaskInitialization "N=@1;Ac=1;Kc=Ac*2/(N-1);td=@2;" MaskDisplay "disp('MASK\\nmap')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2|[T,0]" System { Name "MASK map" Location [520, 162, 902, 335] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType Inport Name "in_1" Position [40, 30, 60, 50] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Gain Name "Gain" Position [180, 25, 220, 55] Gain "Kc" } Block { BlockType Constant Name "Gain diff" Position [180, 96, 215, 124] Value "Ac" } Block { BlockType Sum Name "Sum1" Ports [2, 1, 0, 0, 0] Position [250, 63, 270, 87] Inputs "+-" } Block { BlockType ZeroOrderHold Name "Zero-Order\nHold" Position [100, 24, 135, 56] SampleTime "td" } Block { BlockType Outport Name "out_1" Position [315, 65, 335, 85] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Gain" SrcPort 1 Points [5, 0; 0, 30] DstBlock "Sum1" DstPort 1 } Line { SrcBlock "Gain diff" SrcPort 1 Points [10, 0; 0, -30] DstBlock "Sum1" DstPort 2 } Line { SrcBlock "Sum1" SrcPort 1 DstBlock "out_1" DstPort 1 } Line { SrcBlock "in_1" SrcPort 1 DstBlock "Zero-Order\nHold" DstPort 1 } Line { SrcBlock "Zero-Order\nHold" SrcPort 1 DstBlock "Gain" DstPort 1 } } } Block { BlockType Mux Name "Mux: w/out" Ports [2, 1, 0, 0, 0] Position [585, 31, 615, 64] Inputs "2" } Block { BlockType TransferFcn Name "RC circuit" Position [270, 117, 355, 183] Numerator "[1]" Denominator "[1/(10) 1]" } Block { BlockType SubSystem Name "Sampled read with\nsynchronized pulse" Ports [0, 2, 0, 0, 0] Position [20, 138, 100, 182] ShowName off ShowPortLabels off MaskType "Read from workspace" MaskDescription "Read from a workspace variable at\nsampling tim" "e 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) row, the block will cyc" "lically output from the first row of the variable or output zeros based on th" "e cyclic control entree. The second output is the synchronization pulse, whic" "h outputs a spike when the data is refreshed." MaskPromptString "Variable (column_number=block_output_length):|D" "ata output sample time (sec):|Cyclic control (1: cyclic read, 0: output zeros" " after eof).|Initial output:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" MaskInitialization "var=@1;td=@2;ts=td(1);if (length(td)>=2),off=td" "(2);else off=0;end;cyc=@3;ini=@4;[x,y]=srcsicon(7);[v,w]=trigicon(1,75,get_pa" "ram(gcb,'orientation'),2);" MaskDisplay "plot(0,0,100,100,x,y,v,w);disp('Rd wksp')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "randint(300,1,2)|T|1|0" System { Name "Sampled read with\nsynchronized pulse" Location [355, 527, 737, 674] Open off ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType "S-Function" Name "Message source" Ports [1, 1, 0, 0, 0] Position [180, 53, 255, 97] BackgroundColor yellow FunctionName "trigwksp" Parameters "var,thd,cyclFlag,ini" PortCounts "[]" SFunctionModules "''" 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 workspace " "variable. The output is refreshed at the raising edge of the input pulse." MaskPromptString "Read the variable:|Threshold for the input " "pulse:|Cyclic read variable (1) or amend zeros (0).|Output before first trigg" "er:" MaskStyleString "edit,edit,edit,edit" MaskTunableValueString "on,on,on,on" 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, 0, 0, 0] Position [50, 56, 110, 94] ShowPortLabels off MaskType "Pulse generator" MaskDescription "Vector pulses with sample rate of each puls" "e as Sample_time ./Divider. " MaskHelp "This block generator a vector pulses. The o" "utput length is the same as the vector defined in \"Divider\". The ith elemen" "t of the output has the sample time Sample_time/Divider(i). All elements in " "\"Divider\" must be integers." MaskPromptString "Sample time (scalar, sec):|Divider (integer" " vector):|Offset (have same dimension as Divider:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" 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 ToolBar off StatusBar off ScreenColor white PaperOrientation landscape PaperPositionMode auto PaperType usletter PaperUnits inches Block { BlockType "S-Function" Name "S-function1" Ports [0, 1, 0, 0, 0] Position [40, 31, 105, 59] FunctionName "homopuls" Parameters "samp_time, out_divid, offset" PortCounts "[]" SFunctionModules "''" } Block { BlockType Outport Name "Outport" Position [160, 35, 180, 55] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "S-function1" SrcPort 1 DstBlock "Outport" DstPort 1 } } } Block { BlockType Outport Name "out_1" Position [295, 65, 315, 85] Port "1" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "out_2" Position [195, 115, 215, 135] Port "2" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Message source" SrcPort 1 DstBlock "out_1" DstPort 1 } Line { SrcBlock "Pulses deivide\nsame sample time1" SrcPort 1 Points [20, 0] Branch { DstBlock "Message source" DstPort 1 } Branch { Points [0, 50] DstBlock "out_2" DstPort 1 } } } } Line { SrcBlock "RC circuit" SrcPort 1 DstBlock "AWGN\nchannel" DstPort 1 } Line { SrcBlock "MASK map" SrcPort 1 Points [0, 0] Branch { DstBlock "RC circuit" DstPort 1 } Branch { Points [10, 0; 0, -110] DstBlock "Mux: w/out" DstPort 1 } } Line { SrcBlock "AWGN\nchannel" SrcPort 1 Points [0, 0] Branch { Points [15, 0; 0, -95] DstBlock "Mux: w/out" DstPort 2 } Branch { DstBlock "MASK demap: MF1" DstPort 1 } Branch { Points [15, 0; 0, 75] DstBlock "EyeDiagramNoFilter" DstPort 1 } } Line { SrcBlock "MASK demap: MF1" SrcPort 1 Points [20, 0; 0, -25] DstBlock "EMNoFilter" DstPort 2 } Line { SrcBlock "Sampled read with\nsynchronized pulse" SrcPort 1 Points [0, 0] Branch { DstBlock "MASK map" DstPort 1 } Branch { Points [15, 0; 0, -45] DstBlock "EMNoFilter" DstPort 1 } } Line { SrcBlock "Sampled read with\nsynchronized pulse" SrcPort 2 Points [15, 0; 0, 75] DstBlock "EyeDiagramNoFilter" DstPort 2 } Line { SrcBlock "Mux: w/out" SrcPort 1 DstBlock "GraphNoFilter" DstPort 1 } } }