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

    %% Transition and Preshoot Information of a 2.3 V Step Waveform

%%
% *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).

%%
% Compute transition and preshoot information of a 2.3 V step waveform
% sampled at 4 MHz.
% Load the data.
load('transitionex.mat', 'x');
 
%%
% Construct the |dsp.TransitionMetrics| object.
% Set the |SampleRate| property to |4 MHz|, |StateLevelsSource| property
% to |'Auto'| to estimate the state levels from the data. Set the 
% |PreshootOutputPort| property to |true| to output pretransition
% aberration metrics when you call |step|.
 
htm1 = dsp.TransitionMetrics('SampleRate',4e6, ...
                                 'StateLevelsSource','Auto', ...
                                 'PreshootOutputPort',true)
                             
%%
% Call |step| to compute the transition and preshoot information. 
% Plot the result.
[transition, preshoot] = htm1(x) 
plot(htm1)