Library { Name "lab2_intro_dsp" Version 6.3 MdlSubVersion 0 Description "Blocks used specifically for ECE557 labs." SavedCharacterEncoding "windows-1252" LibraryType "BlockLibrary" SaveDefaultBlockParams on SampleTimeColors off LibraryLinkDisplay "none" WideLines off ShowLineDimensions off ShowPortDataTypes off ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeReport off CovReportOnPause on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off Created "Wed Jun 18 18:34:10 2008" Creator "pavlict" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "tpavlic" ModifiedDateFormat "%" LastModifiedDate "Wed Aug 6 08:28:23 2008" ModelVersionFormat "1.%" ConfigurationManager "None" LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "normal" ExtModeTrigPort "1" ExtModeTrigElement "any" ExtModeTrigDuration 1000 ExtModeTrigDurationFloating "auto" ExtModeTrigHoldOff 0 ExtModeTrigDelay 0 ExtModeTrigDirection "rising" ExtModeTrigLevel 0 ExtModeArchiveMode "off" ExtModeAutoIncOneShot off ExtModeIncDirWhenArm off ExtModeAddSuffixToVar off ExtModeWriteAllDataToWs off ExtModeArmWhenConnect on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock off StrictBusMsg "Warning" ProdHWDeviceType "Specified" ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off BlockDefaults { Orientation "right" ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on } BlockParameterDefaults { Block { BlockType Abs SaturateOnIntegerOverflow on ZeroCross on SampleTime "-1" } Block { BlockType Constant Value "1" VectorParams1D on OutDataTypeMode "Inherit from 'Constant value'" OutDataType "sfix(16)" ConRadixGroup "Use specified scaling" OutScaling "2^0" SampleTime "inf" } Block { BlockType Inport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" LatchByDelayingOutsideSignal off LatchByCopyingInsideSignal off Interpolate on } Block { BlockType Outport Port "1" UseBusObject off BusObject "BusObject" BusOutputAsStruct off PortDimensions "-1" SampleTime "-1" DataType "auto" OutDataType "sfix(16)" OutScaling "2^0" SignalType "auto" SamplingMode "auto" OutputWhenDisabled "held" InitialOutput "[]" } Block { BlockType SignalGenerator WaveForm "sine" TimeSource "Use simulation time" Amplitude "1" Frequency "1" Units "Hertz" VectorParams1D on } Block { BlockType SubSystem ShowPortLabels on Permissions "ReadWrite" PermitHierarchicalResolution "All" SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType Sum IconShape "rectangular" Inputs "++" InputSameDT on OutDataTypeMode "Same as first input" OutDataType "sfix(16)" OutScaling "2^0" LockScale off RndMeth "Floor" SaturateOnIntegerOverflow on SampleTime "-1" } Block { BlockType TriggerPort TriggerType "rising" StatesWhenEnabling "inherit" ShowOutputPort off OutputDataType "auto" SampleTimeType "triggered" SampleTime "1" ZeroCross on } } AnnotationDefaults { HorizontalAlignment "center" VerticalAlignment "middle" ForegroundColor "black" BackgroundColor "white" DropShadow off FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" } LineDefaults { FontName "Arial" FontSize 9 FontWeight "normal" FontAngle "normal" } System { Name "lab2_intro_dsp" Location [93, 295, 1129, 991] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "lightBlue" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType SubSystem Name "Sample and Hold" Ports [1, 1] Position [560, 26, 615, 64] TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskHideContents off MaskType "Samples and holds input at specified frequency." MaskPromptString "Sample Frequency (Hz):" MaskStyleString "edit" MaskTunableValueString "on" MaskEnableString "on" MaskVisibilityString "on" MaskToolTipString "on" MaskVariables "sahfreq=@1;" MaskDisplay "plot([0 1 1 2 2 3 3 4 4 5 5 6],[0 0 4 4 3 3 1 1" " 2.5 2.5 3.5 3.5])" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "10" System { Name "Sample and Hold" Location [848, 234, 1350, 481] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In" Position [150, 98, 180, 112] IconDisplay "Port number" } Block { BlockType SignalGenerator Name "Sample Trigger" Ports [0, 1] Position [240, 35, 270, 65] Orientation "down" NamePlacement "alternate" WaveForm "square" Frequency "sahfreq" } Block { BlockType SubSystem Name "Sample and Hold" Ports [1, 1, 0, 1] Position [205, 84, 305, 126] TreatAsAtomicUnit on MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskHideContents off System { Name "Sample and Hold" Location [94, 100, 509, 253] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Inport Name "In" Position [110, 103, 140, 117] IconDisplay "Port number" } Block { BlockType TriggerPort Name "Trigger" Ports [] Position [190, 20, 210, 40] StatesWhenEnabling "held" } Block { BlockType Outport Name "Out" Position [360, 103, 390, 117] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "In" SrcPort 1 DstBlock "Out" DstPort 1 } } } Block { BlockType Outport Name "Out" Position [350, 98, 380, 112] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "Sample and Hold" SrcPort 1 DstBlock "Out" DstPort 1 } Line { SrcBlock "In" SrcPort 1 Points [0, 0] DstBlock "Sample and Hold" DstPort 1 } Line { SrcBlock "Sample Trigger" SrcPort 1 DstBlock "Sample and Hold" DstPort trigger } Annotation { Name "Copyright (c) 2008 by Theodore P. Pavlic\n" "\nThis work is licensed under the Creative Commons Attribution-Noncommercial " "3.0 United States License.\nTo view a copy of this license, visit http://crea" "tivecommons.org/licenses/by-nc/3.0/us/ or send a\nletter to Creative Commons," " 171 Second Street, Suite 300, San Francisco, California, 94105, USA." Position [252, 185] BackgroundColor "gray" DropShadow on UseDisplayTextAsClickCallback off } } } Block { BlockType SubSystem Name "Triangle Wave" Ports [0, 1] Position [405, 26, 450, 64] TreatAsAtomicUnit off MinAlgLoopOccurrences off RTWSystemCode "Auto" MaskHideContents off MaskType "Outputs a triangle wave." MaskPromptString "Frequency (Hz):|Amplitude:|Offset:" MaskStyleString "edit,edit,edit" MaskTunableValueString "on,on,on" MaskCallbackString "||" MaskEnableString "on,on,on" MaskVisibilityString "on,on,on" MaskToolTipString "on,on,on" MaskVarAliasString ",," MaskVariables "trifreq=@1;triamp=@2;trioff=@3;" MaskDisplay "plot([0.5 1 2 3 4 4.5], [0 1 -1 1 -1 0])" MaskSelfModifiable on MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" MaskValueString "1|1|0" MaskTabNameString ",," Port { PortNumber 1 Name "Triangle" RTWStorageClass "Auto" DataLoggingNameMode "SignalName" } System { Name "Triangle Wave" Location [1574, 136, 2092, 370] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "usletter" PaperUnits "inches" ZoomFactor "100" Block { BlockType Abs Name "Absolute Sawtooth Triangle" Position [175, 25, 205, 55] SaturateOnIntegerOverflow off } Block { BlockType Constant Name "Offset" Position [292, 90, 368, 125] Orientation "up" Value "-triamp + trioff" } Block { BlockType SignalGenerator Name "Sawtooth" Ports [0, 1] Position [70, 25, 100, 55] WaveForm "sawtooth" Amplitude "triamp*2" Frequency "trifreq" } Block { BlockType Sum Name "Triangle Wave" Ports [2, 1] Position [320, 30, 340, 50] NamePlacement "alternate" IconShape "round" Inputs "|++" InputSameDT off OutDataTypeMode "Inherit via internal rule" SaturateOnIntegerOverflow off } Block { BlockType Outport Name "Out" Position [435, 33, 465, 47] IconDisplay "Port number" BusOutputAsStruct off } Line { SrcBlock "Triangle Wave" SrcPort 1 Points [0, 0] DstBlock "Out" DstPort 1 } Line { SrcBlock "Offset" SrcPort 1 Points [0, 0] DstBlock "Triangle Wave" DstPort 2 } Line { SrcBlock "Absolute Sawtooth Triangle" SrcPort 1 Points [0, 0] DstBlock "Triangle Wave" DstPort 1 } Line { SrcBlock "Sawtooth" SrcPort 1 Points [55, 0] DstBlock "Absolute Sawtooth Triangle" DstPort 1 } Annotation { Name "Freq: trifreq\nAmp: 2*triamp\nOffset: 0" Position [90, 97] BackgroundColor "lightBlue" UseDisplayTextAsClickCallback off } Annotation { Name "Amp: triamp\nOffset: triamp" Position [191, 91] BackgroundColor "lightBlue" UseDisplayTextAsClickCallback off } Annotation { Name "Copyright (c) 2008 by Theodore P. Pavlic\n" "\nThis work is licensed under the Creative Commons Attribution-Noncommercial " "3.0 United States License.\nTo view a copy of this license, visit http://crea" "tivecommons.org/licenses/by-nc/3.0/us/ or send a\nletter to Creative Commons," " 171 Second Street, Suite 300, San Francisco, California, 94105, USA." Position [257, 175] BackgroundColor "gray" DropShadow on UseDisplayTextAsClickCallback off } } } Annotation { Name "*AT-HOME* NOTES FOR THESE BLOCKS:\n\n1. Go to F" "ile -> New -> Model\n\n2. Go to Simulation -> Configuration Parameters -> Sol" "ver\n\n3. Set:\n\n *) Type: Fixed-step\n *) Solver: ode5\n *) Fixed-" "step size: 0.001\n\nThe \"Start time\" and \"Stop time\" are up to you (try 0" " and 10, respectively).\nThe \"Fixed-step size\" should be SMALLER than 1/10 " "of your triangle wave \nperiod.\n\n4. Drag these blocks onto your new model a" "nd use them as you wish.\n Remember to change Triangle frequency and ZOH s" "ample time.\n\n5. You can use a \"Scope\" (from the \"Sources\") to probe sig" "nals. The\n \"Autoscale\" features of the \"Scope\" may be handy (or you c" "ould just\n send the output to the workspace and plot it there).\n\nNOTE: " "If you're not using dSPACE, the \"Sample and Hold\" block is nearly\n " " identical to the \"Zero-Order Hold\" block in the \"Discrete\" section of" "\n the standard Simulink library. You may use that block instead." "\n\nNOTE: If you right-click on these blocks and select \"Look Under Mask,\" " "\n you can see how they're built with standard Simulink component" "s." Position [19, 344] HorizontalAlignment "left" UseDisplayTextAsClickCallback off FontSize 14 } Annotation { Name "*IN-CLASS* NOTES FOR LABORATORY 2:\n\nFor best " "dSPACE results with these blocks, go to:\n \n Simulation -> Configuration " "Parameters -> RTI variable description\n\nand turn on \"Include mask and work" "space parameters.\" Otherwise, you can\naccess the subsystem internals in dSP" "ACE directly.\n\nTo use the \"Triangle Wave' and \"Sample and Hold\":\n\n1. T" "o generate a triangle wave with the DSP, use the \"Triangle Wave\" block. \n " " Its shape can be tuned in dSPACE using its parameters.\n\n2. The \"Sample " "and Hold\" block is similar to MATLAB's Zero-Order Hold, but \n its sample" " time can be accessed in dSPACE." Position [519, 319] HorizontalAlignment "left" UseDisplayTextAsClickCallback off FontSize 14 } Annotation { Name "Copyright (c) 2008 by Theodore P. Pavlic\n\nThi" "s work is licensed under the Creative Commons Attribution-Noncommercial 3.0 U" "nited States License.\nTo view a copy of this license, visit http://creativec" "ommons.org/licenses/by-nc/3.0/us/ or send a\nletter to Creative Commons, 171 " "Second Street, Suite 300, San Francisco, California, 94105, USA." Position [532, 645] BackgroundColor "gray" DropShadow on UseDisplayTextAsClickCallback off } } }