www.gusucode.com > rf 案例源码程序 matlab代码 > rf/CalculateStepResponseExample.m

    %% Calculate Step Response
% Calculate the step response of a rational function object from the file 
% |passive.s2p|. Read |passive.s2p|.
S = sparameters('passive.s2p');
freq = S.Frequencies;
%%
% Get S11 and convert to a TDR transfer function.
s11 = rfparam(S,1,1);
Vin = 1;
tdrfreqdata = Vin*(s11+1)/2;
%%
% Fit to a rational function object.
tdrfit = rationalfit(freq,tdrfreqdata);
%%
% Define parameters for a step signal.
 % Define parameters for a step signal
Ts = 1.0e-11;
N = 10000;
Trise = 1.0e-10;
%%
% Calculate the step response for TDR and plot it
[tdr,t1] = stepresp(tdrfit,Ts,N,Trise);
figure
plot(t1*1e9,tdr)
ylabel('TDR')
xlabel('Time (ns)')