Impulse response for rational function object
While you can compute the output response for a rational function object by
computing the impulse response of the object and then convolving that response with the
input signal, this approach is not recommended. Instead, you should use the
to perform this computation because it generally gives a more accurate output signal for
a given input signal.
sparameters object from a file and use
rfparam to extract the parameters.
S = sparameters('passive.s2p'); S21 = rfparam(S,2,1);
Fit a rational function object to the data by using
freq = S.Frequencies; fit_data = rationalfit(freq,S21)
fit_data = rfmodel.rational with properties: A: [6x1 double] C: [6x1 double] D: 0 Delay: 0 Name: 'Rational Function'
Calculate the impulse response using the
impulse method and plot the results.
[resp,t] = impulse(fit_data,1e-12,1e3); plot(t,resp);
h— Rational function object
Rational function object, specified as a
Complex Number Support: Yes
ts— Sample time of computed impulse response
Sample time of the computed impulse response, specified as a positive scalar integer in seconds.
n— Number of samples
Number of samples, specified as a positive scalar integer.
response— Impulse response
Impulse response, returned as an n element vector of impulse response values.
tout— Sample time of output signal
Sample time of the output signal, returned as a positive scalar integer in seconds.
RF Toolbox™ uses the following equation to for the impulse response:
Delay are properties of the rational function object,
M is the number of poles in the rational function
The vector of time samples of the impulse response,
t, is computed
from the inputs as
t = [0,ts,2*ts,...,(n-1)*ts]