{"id":1857,"date":"2013-03-25T16:07:11","date_gmt":"2013-03-25T21:07:11","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/?p=1857"},"modified":"2013-03-26T09:24:31","modified_gmt":"2013-03-26T14:24:31","slug":"new-for-r2013a-time-scope-with-triggering","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2013\/03\/25\/new-for-r2013a-time-scope-with-triggering\/","title":{"rendered":"New for R2013a: Time Scope with Triggering!"},"content":{"rendered":"<p><em>Today we are happy to welcome guest blogger Kirthi Devleker to talk about a new trigger functionality added to the Time Scope in R2013a.<\/em><\/p>\r\n\r\n<p>Did you know that a Trigger functionality is now available with the <a href=\"https:\/\/blogs.mathworks.com\/seth\/2012\/04\/16\/a-scope-for-simulink-and-matlab\/\" target=\"_blank\">Time Scope<\/a> in the DSP System Toolbox (R2013a) ? The Time Scope ships both as a System object and also as a Simulink block with the<a href=\"https:\/\/www.mathworks.com\/products\/dsp-system\/\"> DSP System Toolbox<\/a><\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/1.gif\"><img decoding=\"async\" title=\"Before Triggering\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/1.gif\" alt=\"Time Scope without trigger\" \/><\/a>    \r\n<a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/2.gif\"><img decoding=\"async\" title=\"After Enabling Trigger\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/2.gif\" alt=\"Time Scope with trigger\"\/><\/a><\/p>\r\n\r\n<p>Triggers are ubiquitous on real-world hardware oscilloscopes. They are useful to analyze signals,specifically to stabilize a repetitive waveform and search for a occurrence of a  particular pattern in the signal.<\/p>\r\n\r\n<p><strong>Trigger Modes<\/strong>:<\/p>\r\n\r\n<p>The Trigger in Time Scope supports 3 different modes of operation for a given trigger type. They are:<\/p>\r\n<ul>\r\n<li>Auto: In this mode, the Time Scope stabilizes the display if the trigger criteria is met or continues to display the incoming signal.<\/li>\r\n<li>Normal : The time scope displays the stabilized signal only if the trigger criteria is met otherwise nothing is displayed.<\/li>\r\n<li>Once: The time scope displays the signal only for the very first time the trigger event is encountered. (Simulation will still keep running)<\/li>\r\n<\/ul>\r\n\r\n<p>Here is an animation showing those different modes:<\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/showAllTriggers.gif\"><img decoding=\"async\" title=\"Triggering modes available in the time scope\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/showAllTriggers.gif\" alt=\"Triggering modes available in the time scope\" \/><\/a><\/li><\/p>\r\n\r\n<p>Let's look at a few more examples<\/p>\r\n\r\n<p><strong>Edge Triggering<\/strong><\/p>\r\n\r\n<p>Let's create a simple sine wave and display it on the Time Scope.<\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/mcode.png\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/mcode.png\" alt=\"Fs = 44.1e3;\r\nSpan = 1e-3\r\nhsin = dsp.SineWave('Amplitude',10,'Frequency',2.2e3,...\r\n    'SampleRate', Fs, 'SamplesPerFrame', 10);\r\nhts = dsp.TimeScope('SampleRate', Fs, 'TimeSpan', Span);\r\n\r\nfor ii = 1:1e5\r\n    x = step(hsin);\r\n    step(hts,x);\r\nend\"\/><\/a><\/p>\r\n\r\n<p>As soon as you click the Trigger button, the triggers panel open allowing you to configure options like level, type, polarity, etc.<\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/triggerDemo.gif\"><img decoding=\"async\"  src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/triggerDemo.gif\" alt=\"Configuring the trigger\"\/><\/a><\/p>\r\n\r\n<p><strong>Runt Triggering<\/strong><\/p>\r\n\r\n<p>What are Runt signals? Runt signals are the signals which typically cross a voltage threshold level but fail to cross a second threshold before re-crossing the first threshold level. Runt signals are frequently encountered in digital circuits.<\/p>\r\n\r\n<p>For example if we look at the following waveform:<\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/pwm_best.gif\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/pwm_best.gif\" alt=\"Noisy PWM signal\"\/><\/a><\/p>\r\n\r\n<p>To look for Runt signals, Let us enable the Trigger, set the Trigger Mode to <em>Normal<\/em>, set the trigger type as <em>Runt<\/em>, adjust the voltage threshold and then the Time Scope detects and displays the presence of any Runt signals in the incoming data stream.<\/p>\r\n\r\n<p><a href=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/runt.gif\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/runt.gif\" alt=\"Runt Trigger\"\/><\/a><\/p>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>Go through the <a href=\"https:\/\/www.mathworks.com\/help\/dsp\/ref\/timescope.html#btsl04t\">trigger documentation<\/a>, give this a try and let us know what you think by leaving a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=1857&#comment\">comment here<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2013Q1\/runt.gif\" onError=\"this.style.display ='none';\" \/><\/div><p>Today we are happy to welcome guest blogger Kirthi Devleker to talk about a new trigger functionality added to the Time Scope in R2013a.\r\n\r\nDid you know that a Trigger functionality is now available... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2013\/03\/25\/new-for-r2013a-time-scope-with-triggering\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,16],"tags":[317,263,316],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/1857"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=1857"}],"version-history":[{"count":36,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/1857\/revisions"}],"predecessor-version":[{"id":2077,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/1857\/revisions\/2077"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=1857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=1857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=1857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}