Model { Name "costas_demo" Version 2.09 SimParamPage WorkspaceI/O SampleTimeColors off InvariantConstants off WideVectorLines off ShowLineWidths off PaperOrientation landscape PaperType usletter PaperUnits inches StartTime "0.0" StopTime "1000" Solver FixedStepDiscrete RelTol "1e-3" AbsTol "1e-3" Refine "1" MaxStep ".0001" InitialStep "auto" FixedStep "Ts" 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 RTWRetainRTWFile off RTWTemplateMakefile "grt_unix.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 "costas_demo" Location [55, 65, 706, 365] Open on ScreenColor white Block { BlockType SubSystem Name "Costas PLL" Ports [1, 1, 0, 0, 0] Position [335, 86, 365, 144] ShowPortLabels off System { Name "Costas PLL" Location [10, 437, 1220, 770] Open off ScreenColor white Block { BlockType Inport Name "Modulated signal" Position [35, 120, 55, 140] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType DiscreteStateSpace Name "Butterworth\nIIR LP Filter 1A" Position [570, 22, 645, 68] A "a" B "b" C "c" D "d" X0 "0" SampleTime "ts" MaskType "butter" MaskDescription "Butterworth low pass filter.\n(Requires " "Signal Processing Toolbox)" MaskHelp "IIR Butterworth low pass filter using " "MATLAB's butter command." MaskPromptString "Cutoff frequency (0 to 1):|Order:|Sample " "time:" MaskStyleString "edit,edit,edit" MaskInitialization "[a,b,c,d]=butter(@2,@1); ts=@3; [num,den]=ss" "2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2s" "s(num,den); end; h=freqz(num,den,64); " MaskDisplay "plot(1:64,abs(h))" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0.1|6|Ts" } Block { BlockType DiscreteStateSpace Name "Butterworth\nIIR LP Filter 1B" Position [565, 227, 640, 273] A "a" B "b" C "c" D "d" X0 "0" SampleTime "ts" MaskType "butter" MaskDescription "Butterworth low pass filter.\n(Requires " "Signal Processing Toolbox)" MaskHelp "IIR Butterworth low pass filter using " "MATLAB's butter command." MaskPromptString "Cutoff frequency (0 to 1):|Order:|Sample " "time:" MaskStyleString "edit,edit,edit" MaskInitialization "[a,b,c,d]=butter(@2,@1); ts=@3; [num,den]=ss" "2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2s" "s(num,den); end; h=freqz(num,den,64); " MaskDisplay "plot(1:64,abs(h))" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0.1|6|Ts" } Block { BlockType DiscreteStateSpace Name "Butterworth\nIIR LP Filter 2" Position [770, 112, 845, 158] A "a" B "b" C "c" D "d" X0 "0" SampleTime "ts" MaskType "butter" MaskDescription "Butterworth low pass filter.\n(Requires " "Signal Processing Toolbox)" MaskHelp "IIR Butterworth low pass filter using " "MATLAB's butter command." MaskPromptString "Cutoff frequency (0 to 1):|Order:|Sample " "time:" MaskStyleString "edit,edit,edit" MaskInitialization "[a,b,c,d]=butter(@2,@1); ts=@3; [num,den]=ss" "2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2s" "s(num,den); end; h=freqz(num,den,64); " MaskDisplay "plot(1:64,abs(h))" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0.01|6|Ts" } Block { BlockType Constant Name "Constant" Position [885, 70, 920, 90] Value "6.28" } Block { BlockType DiscreteFilter Name "Delay N/2" Position [100, 111, 160, 149] Numerator "Delay" Denominator "1" SampleTime "Ts" } Block { BlockType SubSystem Name "Hilbert Transform" Ports [1, 2, 0, 0, 0] Position [395, 107, 425, 158] ShowPortLabels off System { Name "Hilbert Transform" Location [28, 258, 524, 508] Open off ScreenColor white Block { BlockType Inport Name "Input" Position [20, 85, 40, 105] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType DiscreteFilter Name "-90 deg phase shift" Position [165, 151, 225, 189] Numerator "Hilb" Denominator "1" SampleTime "Ts" } Block { BlockType DiscreteFilter Name "Delay N/2" Position [165, 76, 225, 114] Numerator "Delay" Denominator "1" SampleTime "Ts" } Block { BlockType Outport Name "Delayed Input" Position [320, 84, 350, 106] Port "1" OutputWhenDisabled held InitialOutput "0" } Block { BlockType Outport Name "Hilbert TF of Input" Position [325, 160, 345, 180] Port "2" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "-90 deg phase shift" SrcPort 1 DstBlock "Hilbert TF of Input" DstPort 1 } Line { SrcBlock "Delay N/2" SrcPort 1 DstBlock "Delayed Input" DstPort 1 } Line { SrcBlock "Input" SrcPort 1 Points [40, 0] Branch { DstBlock "Delay N/2" DstPort 1 } Branch { Points [0, 75] DstBlock "-90 deg phase shift" DstPort 1 } } } } Block { BlockType SubSystem Name "Hilbert out" Ports [1, 0, 0, 0, 0] Position [605, 116, 635, 154] CopyFcn "set_param(gcb,'userdata',[]);" DeleteFcn "y_tp=get_param(gcb,'userdata');if ishandle(y" "_tp),delete(y_tp);end" NameChangeFcn "set(get_param(gcb,'userdata'),'Name',gcb);" ShowPortLabels off MaskType "Graph scope." MaskDescription "Graph scope using MATLAB graph window.\nEnte" "r plotting ranges and line type." MaskHelp "This block plots to the MATLAB graph " "window and can be used as an improved " "version of the Scope block. Look at the " "m-file sfuny.m to see how it works. This " "block can take scalar or vector input " "signal." MaskPromptString "Time range:|y-min:|y-max:|Line type (rgbw-:*" "). Seperate each plot by '/':" MaskStyleString "edit,edit,edit,edit" MaskInitialization "color = @4; ax = [0, @1, @2, @3]; dt = -1;" MaskDisplay "plot(0,0,100,100,[90,10,10,10,90,90,10],[65," "65,90,40,40,90,90],[90,78,69,54,40,31,25,10]" ",[77,60,48,46,56,75,81,84])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "0.5|-1.1|1.1|'r-/g--/c-./w:/m*/ro/b+'" System { Name "Hilbert out" Location [0, 59, 274, 252] Open off ScreenColor white Block { BlockType Inport Name "x" Position [65, 55, 85, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType S-Function Name "S-function\nM-file which plots\nlines\n" Ports [1, 0, 0, 0, 0] Position [130, 55, 180, 75] FunctionName "sfuny" Parameters "ax, color,dt" } Line { SrcBlock "x" SrcPort 1 DstBlock "S-function\nM-file which plots\nlines\n" DstPort 1 } } } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [550, 116, 580, 149] Inputs "2" } Block { BlockType Product Name "Product1" Ports [2, 1, 0, 0, 0] Position [465, 33, 495, 57] Inputs "2" } Block { BlockType Product Name "Product2" Ports [2, 1, 0, 0, 0] Position [465, 238, 495, 262] Inputs "2" } Block { BlockType Product Name "Product3" Ports [2, 1, 0, 0, 0] Position [695, 123, 725, 147] Inputs "2" } Block { BlockType Gain Name "Q Gain" Position [740, 235, 770, 265] Gain "-2" } Block { BlockType Gain Name "Q Gain1" Position [710, 30, 740, 60] Gain "2" } Block { BlockType SubSystem Name "Q out" Ports [1, 0, 0, 0, 0] Position [785, 26, 815, 64] CopyFcn "set_param(gcb,'userdata',[]);" DeleteFcn "y_tp=get_param(gcb,'userdata');if ishandle(y" "_tp),delete(y_tp);end" NameChangeFcn "set(get_param(gcb,'userdata'),'Name',gcb);" ShowPortLabels off MaskType "Graph scope." MaskDescription "Graph scope using MATLAB graph window.\nEnte" "r plotting ranges and line type." MaskHelp "This block plots to the MATLAB graph " "window and can be used as an improved " "version of the Scope block. Look at the " "m-file sfuny.m to see how it works. This " "block can take scalar or vector input " "signal." MaskPromptString "Time range:|y-min:|y-max:|Line type (rgbw-:*" "). Seperate each plot by '/':" MaskStyleString "edit,edit,edit,edit" MaskInitialization "color = @4; ax = [0, @1, @2, @3]; dt = -1;" MaskDisplay "plot(0,0,100,100,[90,10,10,10,90,90,10],[65," "65,90,40,40,90,90],[90,78,69,54,40,31,25,10]" ",[77,60,48,46,56,75,81,84])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2|-1|1|'r-/g--/c-./w:/m*/ro/b+'" System { Name "Q out" Location [0, 59, 274, 252] Open off ScreenColor white Block { BlockType Inport Name "x" Position [65, 55, 85, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType S-Function Name "S-function\nM-file which plots\nlines\n" Ports [1, 0, 0, 0, 0] Position [130, 55, 180, 75] FunctionName "sfuny" Parameters "ax, color,dt" } Line { SrcBlock "x" SrcPort 1 DstBlock "S-function\nM-file which plots\nlines\n" DstPort 1 } } } Block { BlockType Reference Name "Slider\nGain" Ports [1, 1, 0, 0, 0] Position [880, 119, 935, 151] SourceBlock "simulink/Linear/Slider\nGain" SourceType "Slider Gain" low "0" gain "10" high "100" } Block { BlockType Sum Name "Sum" Ports [2, 1, 0, 0, 0] Position [990, 120, 1010, 140] Inputs "++" } Block { BlockType UnitDelay Name "Unit Delay" Position [1045, 187, 1095, 203] X0 "0" SampleTime "Ts" } Block { BlockType SubSystem Name "VCO Input" Ports [1, 0, 0, 0, 0] Position [1085, 111, 1115, 149] CopyFcn "set_param(gcb,'userdata',[]);" DeleteFcn "y_tp=get_param(gcb,'userdata');if ishandle(y" "_tp),delete(y_tp);end" NameChangeFcn "set(get_param(gcb,'userdata'),'Name',gcb);" ShowPortLabels off MaskType "Graph scope." MaskDescription "Graph scope using MATLAB graph window.\nEnte" "r plotting ranges and line type." MaskHelp "This block plots to the MATLAB graph " "window and can be used as an improved " "version of the Scope block. Look at the " "m-file sfuny.m to see how it works. This " "block can take scalar or vector input " "signal." MaskPromptString "Time range:|y-min:|y-max:|Line type (rgbw-:*" "). Seperate each plot by '/':" MaskStyleString "edit,edit,edit,edit" MaskInitialization "color = @4; ax = [0, @1, @2, @3]; dt = -1;" MaskDisplay "plot(0,0,100,100,[90,10,10,10,90,90,10],[65," "65,90,40,40,90,90],[90,78,69,54,40,31,25,10]" ",[77,60,48,46,56,75,81,84])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "4|0|13|'r-/g--/c-./w:/m*/ro/b+'" System { Name "VCO Input" Location [0, 59, 274, 252] Open off ScreenColor white Block { BlockType Inport Name "x" Position [65, 55, 85, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType S-Function Name "S-function\nM-file which plots\nlines\n" Ports [1, 0, 0, 0, 0] Position [130, 55, 180, 75] FunctionName "sfuny" Parameters "ax, color,dt" } Line { SrcBlock "x" SrcPort 1 DstBlock "S-function\nM-file which plots\nlines\n" DstPort 1 } } } Block { BlockType SubSystem Name "Voltage\nControlled\nOscillator" Ports [1, 1, 0, 0, 0] Position [285, 105, 335, 165] ShowPortLabels off MaskDescription "Voltage Controlled Oscillator" MaskHelp "Converts an input value into a frequency " "output.\\n Y=sin(t*wn+F.M.*u))\\nInput " "values must be >= 0." MaskPromptString "Natural Frequency:|Frequency Multiplier:" MaskStyleString "edit,edit" MaskInitialization "wc=@1;alpha=@2;" MaskDisplay "disp('VCO')" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "56.52|1" System { Name "Voltage\nControlled\nOscillator" Location [238, 249, 1003, 686] Open off ScreenColor white Block { BlockType Inport Name "voltage\nin" Position [60, 120, 80, 140] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Abs Name "Abs" Position [130, 118, 160, 142] } Block { BlockType Clock Name "Clock" Position [35, 175, 55, 195] Location [30, 40, 140, 75] } Block { BlockType Memory Name "Memory" Position [480, 70, 530, 100] Orientation left X0 "0" InheritSampleTime off } Block { BlockType Memory Name "Memory1" Position [475, 320, 525, 350] Orientation left X0 "1" InheritSampleTime off } Block { BlockType Memory Name "Memory2" Position [80, 205, 130, 235] X0 "0" InheritSampleTime off } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [205, 121, 235, 154] Inputs "2" } Block { BlockType Product Name "Product1" Ports [2, 1, 0, 0, 0] Position [395, 115, 420, 135] Inputs "2" } Block { BlockType Product Name "Product2" Ports [2, 1, 0, 0, 0] Position [395, 180, 420, 200] Inputs "2" } Block { BlockType Product Name "Product3" Ports [2, 1, 0, 0, 0] Position [395, 225, 420, 245] Inputs "2" } Block { BlockType Product Name "Product4" Ports [2, 1, 0, 0, 0] Position [395, 265, 420, 285] Inputs "2" } Block { BlockType Fcn Name "cos_h" Position [270, 210, 310, 230] Expr "cos(u[2]*(u[1]*alpha + wc))" } Block { BlockType Sum Name "dt" Ports [2, 1, 0, 0, 0] Position [160, 180, 180, 200] Inputs "+-" } Block { BlockType Sum Name "dt1" Ports [2, 1, 0, 0, 0] Position [500, 155, 520, 175] Inputs "++" } Block { BlockType Sum Name "dt2" Ports [2, 1, 0, 0, 0] Position [505, 240, 525, 260] Inputs "-+" } Block { BlockType Fcn Name "sin_h" Position [270, 130, 310, 150] Expr "sin(u[2]*(u[1]*alpha + wc))" } Block { BlockType Outport Name "sin_out" Position [600, 155, 620, 175] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "cos_h" SrcPort 1 Points [25, 0] Branch { Points [0, -90] DstBlock "Product1" DstPort 2 } Branch { Points [0, 60] DstBlock "Product4" DstPort 2 } } Line { SrcBlock "sin_h" SrcPort 1 Points [45, 0; 0, 55] Branch { DstBlock "Product2" DstPort 2 } Branch { Points [0, 45] DstBlock "Product3" DstPort 2 } } Line { SrcBlock "Memory1" SrcPort 1 Points [-120, 0; 0, -65] Branch { Points [0, -85] DstBlock "Product2" DstPort 1 } Branch { DstBlock "Product4" DstPort 1 } } Line { SrcBlock "Memory" SrcPort 1 Points [-105, 0; 0, 35] Branch { DstBlock "Product1" DstPort 1 } Branch { Points [0, 110] DstBlock "Product3" DstPort 1 } } Line { SrcBlock "dt2" SrcPort 1 Points [30, 0; 0, 85] DstBlock "Memory1" DstPort 1 } Line { SrcBlock "Product2" SrcPort 1 Points [30, 0; 0, -20] DstBlock "dt1" DstPort 2 } Line { SrcBlock "Product1" SrcPort 1 Points [30, 0; 0, 35] DstBlock "dt1" DstPort 1 } Line { SrcBlock "Product4" SrcPort 1 Points [30, 0; 0, -20] DstBlock "dt2" DstPort 2 } Line { SrcBlock "Product3" SrcPort 1 Points [30, 0; 0, 10] DstBlock "dt2" DstPort 1 } Line { SrcBlock "Mux" SrcPort 1 Points [10, 0] Branch { DstBlock "sin_h" DstPort 1 } Branch { Points [0, 80] DstBlock "cos_h" DstPort 1 } } Line { SrcBlock "dt" SrcPort 1 Points [10, 0; 0, -15; -10, 0; 0, -30] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Memory2" SrcPort 1 Points [10, 0] DstBlock "dt" DstPort 2 } Line { SrcBlock "Clock" SrcPort 1 Points [0, 0] Branch { DstBlock "dt" DstPort 1 } Branch { Points [5, 0] DstBlock "Memory2" DstPort 1 } } Line { SrcBlock "dt1" SrcPort 1 Points [0, 0] Branch { Points [35, 0; 0, -80] DstBlock "Memory" DstPort 1 } Branch { DstBlock "sin_out" DstPort 1 } } Line { SrcBlock "Abs" SrcPort 1 DstBlock "Mux" DstPort 1 } Line { SrcBlock "voltage\nin" SrcPort 1 DstBlock "Abs" DstPort 1 } Annotation { Position [217, 352] VerticalAlignment top Text "To solve the equation \nsin((u*alpha+wn)" "*(t+dt)) = sin((u*alpha+wn)*t + (u*alpha" "+wn)*dt)\nat time t+dt" } Annotation { Position [57, 32] VerticalAlignment top Text "limit input voltage\nto prevent o/p " "of\nnegative frequencies" } Annotation { Position [197, 287] VerticalAlignment top Text "Uses the trigonometric identites\nsin(A+" "B) = sin(A)cos(B)+cos(A)sin(B)\ncos(A+B)" " = cos(A)cos(B)-sin(A)sin(B)" } } } Block { BlockType Outport Name "out_1" Position [820, 240, 840, 260] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Hilbert out" DstPort 1 } Line { SrcBlock "Product1" SrcPort 1 DstBlock "Butterworth\nIIR LP Filter 1A" DstPort 1 } Line { SrcBlock "Product3" SrcPort 1 DstBlock "Butterworth\nIIR LP Filter 2" DstPort 1 } Line { SrcBlock "Butterworth\nIIR LP Filter 2" SrcPort 1 DstBlock "Slider\nGain" DstPort 1 } Line { SrcBlock "Constant" SrcPort 1 Points [25, 0; 0, 45] DstBlock "Sum" DstPort 1 } Line { SrcBlock "Product2" SrcPort 1 DstBlock "Butterworth\nIIR LP Filter 1B" DstPort 1 } Line { SrcBlock "Voltage\nControlled\nOscillator" SrcPort 1 DstBlock "Hilbert Transform" DstPort 1 } Line { SrcBlock "Hilbert Transform" SrcPort 1 Points [0, 0] Branch { Points [5, 0; 0, -70] DstBlock "Product1" DstPort 2 } Branch { Points [35, 0; 0, 5] DstBlock "Mux" DstPort 1 } } Line { SrcBlock "Hilbert Transform" SrcPort 2 Points [0, 0] Branch { Points [5, 0; 0, 100] DstBlock "Product2" DstPort 1 } Branch { Points [35, 0; 0, -5] DstBlock "Mux" DstPort 2 } } Line { SrcBlock "Sum" SrcPort 1 Points [0, 0] Branch { DstBlock "VCO Input" DstPort 1 } Branch { Points [5, 0; 0, 65] DstBlock "Unit Delay" DstPort 1 } } Line { SrcBlock "Unit Delay" SrcPort 1 Points [10, 0; 0, 110; -845, 0; 0, -170] DstBlock "Voltage\nControlled\nOscillator" DstPort 1 } Line { SrcBlock "Modulated signal" SrcPort 1 DstBlock "Delay N/2" DstPort 1 } Line { SrcBlock "Delay N/2" SrcPort 1 Points [0, 0] Branch { Points [0, -90] DstBlock "Product1" DstPort 1 } Branch { Points [0, 125] DstBlock "Product2" DstPort 2 } } Line { SrcBlock "Slider\nGain" SrcPort 1 DstBlock "Sum" DstPort 2 } Line { SrcBlock "Butterworth\nIIR LP Filter 1B" SrcPort 1 Points [0, 0] Branch { Points [20, 0; 0, -110] DstBlock "Product3" DstPort 2 } Branch { DstBlock "Q Gain" DstPort 1 } } Line { SrcBlock "Q Gain" SrcPort 1 DstBlock "out_1" DstPort 1 } Line { SrcBlock "Butterworth\nIIR LP Filter 1A" SrcPort 1 Points [0, 0] Branch { Points [15, 0; 0, 85] DstBlock "Product3" DstPort 1 } Branch { DstBlock "Q Gain1" DstPort 1 } } Line { SrcBlock "Q Gain1" SrcPort 1 DstBlock "Q out" DstPort 1 } Annotation { Position [823, 221] Text "In-Phase Component" } Annotation { Position [808, 18] Text "Quadrature Component" } Annotation { Position [303, 90] Text "VCO outpus a sine rather than cosine,\nso " "I and Q are defined carefully." } } } Block { BlockType SubSystem Name "DSB Modulator" Ports [1, 1, 0, 0, 0] Position [125, 90, 155, 140] ShowPortLabels off System { Name "DSB Modulator" Location [564, 693, 892, 914] Open off ScreenColor white Block { BlockType Inport Name "Message" Position [35, 60, 55, 80] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType Product Name "Product" Ports [2, 1, 0, 0, 0] Position [115, 73, 145, 97] Inputs "2" } Block { BlockType Sin Name "TX Carrier" Position [35, 105, 55, 125] Amplitude "1" Frequency "62.8" Phase "pi/2" SampleTime "-1" } Block { BlockType Outport Name "DSB Modulated" Position [215, 75, 235, 95] Port "1" OutputWhenDisabled held InitialOutput "0" } Line { SrcBlock "Product" SrcPort 1 DstBlock "DSB Modulated" DstPort 1 } Line { SrcBlock "Message" SrcPort 1 Points [20, 0; 0, 10] DstBlock "Product" DstPort 1 } Line { SrcBlock "TX Carrier" SrcPort 1 Points [20, 0; 0, -25] DstBlock "Product" DstPort 2 } } } Block { BlockType Sin Name "Message m(t)" Position [40, 105, 60, 125] Amplitude "1" Frequency "6.28" Phase "1" SampleTime "-1" } Block { BlockType SubSystem Name "Modulated signal" Ports [1, 0, 0, 0, 0] Position [225, 56, 255, 94] CopyFcn "set_param(gcb,'userdata',[]);" DeleteFcn "y_tp=get_param(gcb,'userdata');if ishandle(y_tp)" ",delete(y_tp);end" NameChangeFcn "set(get_param(gcb,'userdata'),'Name',gcb);" ShowPortLabels off MaskType "Graph scope." MaskDescription "Graph scope using MATLAB graph window.\nEnter " "plotting ranges and line type." MaskHelp "This block plots to the MATLAB graph window " "and can be used as an improved version of " "the Scope block. Look at the m-file sfuny.m " "to see how it works. This block can take " "scalar or vector input signal." MaskPromptString "Time range:|y-min:|y-max:|Line type (rgbw-:*). " "Seperate each plot by '/':" MaskStyleString "edit,edit,edit,edit" MaskInitialization "color = @4; ax = [0, @1, @2, @3]; dt = -1;" MaskDisplay "plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,9" "0,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60," "48,46,56,75,81,84])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2|-1|1|'r-/g--/c-./w:/m*/ro/b+'" System { Name "Modulated signal" Location [0, 59, 274, 252] Open off ScreenColor white Block { BlockType Inport Name "x" Position [65, 55, 85, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType S-Function Name "S-function\nM-file which plots\nlines\n" Ports [1, 0, 0, 0, 0] Position [130, 55, 180, 75] FunctionName "sfuny" Parameters "ax, color,dt" } Line { SrcBlock "x" SrcPort 1 DstBlock "S-function\nM-file which plots\nlines\n" DstPort 1 } } } Block { BlockType Mux Name "Mux" Ports [2, 1, 0, 0, 0] Position [425, 62, 460, 98] Inputs "2" } Block { BlockType SubSystem Name "Plot Input\nand Output" Ports [1, 0, 0, 0, 0] Position [500, 61, 530, 99] CopyFcn "set_param(gcb,'userdata',[]);" DeleteFcn "y_tp=get_param(gcb,'userdata');if ishandle(y_tp)" ",delete(y_tp);end" NameChangeFcn "set(get_param(gcb,'userdata'),'Name',gcb);" ShowPortLabels off MaskType "Graph scope." MaskDescription "Graph scope using MATLAB graph window.\nEnter " "plotting ranges and line type." MaskHelp "This block plots to the MATLAB graph window " "and can be used as an improved version of " "the Scope block. Look at the m-file sfuny.m " "to see how it works. This block can take " "scalar or vector input signal." MaskPromptString "Time range:|y-min:|y-max:|Line type (rgbw-:*). " "Seperate each plot by '/':" MaskStyleString "edit,edit,edit,edit" MaskInitialization "color = @4; ax = [0, @1, @2, @3]; dt = -1;" MaskDisplay "plot(0,0,100,100,[90,10,10,10,90,90,10],[65,65,9" "0,40,40,90,90],[90,78,69,54,40,31,25,10],[77,60," "48,46,56,75,81,84])" MaskIconFrame on MaskIconOpaque on MaskIconRotate none MaskIconUnits autoscale MaskValueString "2|-1|1|'r-/g--/c-./w:/m*/ro/b+'" System { Name "Plot Input\nand Output" Location [0, 59, 274, 252] Open off ScreenColor white Block { BlockType Inport Name "x" Position [65, 55, 85, 75] Port "1" PortWidth "-1" SampleTime "-1" } Block { BlockType S-Function Name "S-function\nM-file which plots\nlines\n" Ports [1, 0, 0, 0, 0] Position [130, 55, 180, 75] FunctionName "sfuny" Parameters "ax, color,dt" } Line { SrcBlock "x" SrcPort 1 DstBlock "S-function\nM-file which plots\nlines\n" DstPort 1 } } } Line { SrcBlock "DSB Modulator" SrcPort 1 Points [0, 0] Branch { Points [10, 0; 0, -40] DstBlock "Modulated signal" DstPort 1 } Branch { DstBlock "Costas PLL" DstPort 1 } } Line { SrcBlock "Mux" SrcPort 1 DstBlock "Plot Input\nand Output" DstPort 1 } Line { SrcBlock "Costas PLL" SrcPort 1 Points [40, 0] DstBlock "Mux" DstPort 2 } Line { SrcBlock "Message m(t)" SrcPort 1 Points [5, 0] Branch { DstBlock "DSB Modulator" DstPort 1 } Branch { Points [0, -70; 340, 0] DstBlock "Mux" DstPort 1 } } } }