%% Slew Rates for 2.3 V Digital Clock
% Note: If you are using R2016a or an earlier release, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).
% Find the slew rates of the leading and trailing edges of a 2.3 V digital clock sampled at 4 MHz.

 load('pulseex.mat','x','t');

%
% Construct the dsp.PulseMetrics object. Set the TransitionOutputPort property to true to report transition metrics for the initial and final transitions. Set the StateLevelsSource property to 'Auto' to estimate the state levels from the data.

 pm = dsp.PulseMetrics('SampleRate',4e6, ...
                            'TransitionOutputPort', true, ...
                            'StateLevelsSource','Auto');

%
% Compute the pulse and transition metrics and plot the result.

 [pulse,transition] = pm(x); 
 plot(pm);

% Copyright 2012 The MathWorks, Inc.