www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/SlewRatesFor23VDigitalClockExample.m

    %% Slew Rates for 2.3 V Digital Clock
%%
% *Note*: This example runs only in R2016b or later. If you are using an 
% earlier release, replace each call to the function with the equivalent 
% |step| syntax. For example, myObject(x) becomes step(myObject,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. 

 hpm2 = dsp.PulseMetrics('SampleRate',4e6, ...
                            'TransitionOutputPort', true, ...
                            'StateLevelsSource','Auto');
 %% 
 % Compute the pulse and transition metrics and plot the result.
 [pulse, transition] = hpm2(x); 
 plot(hpm2);