Main Content

timeresp

Time response for rational object and rationalfit function object

Description

example

[outputsignal,t] = timeresp(h,inputsignal,ts) computes the output signal that the rational function object produces in response to a give input signal at the specified sample time, ts.

Examples

collapse all

Define the input signal.

SampleTime = 2e-11;
OverSamplingFactor = 25;
TotalSampleNumber = 2^12;
InputSignal = sign(randn(1, ...
              ceil(TotalSampleNumber/OverSamplingFactor)));
InputSignal = repmat(InputSignal, [OverSamplingFactor, 1]);
InputSignal = InputSignal(:);

Create a rational function object.

S = sparameters('default.s2p');
s21 = rfparam(S,2,1);
datafreq = S.Frequencies;
fit_data = rationalfit(datafreq,s21,'Tolerance',-32);

Compute the time response.

[y,t]=timeresp(fit_data,InputSignal,SampleTime);

Input Arguments

collapse all

Time varying input signal, specified as a real finite vector.

Data Types: double

Rational function object, specified as a rationalfit object.

Data Types: double
Complex Number Support: Yes

Sample time of the input signal, specified as a positive scalar integer in seconds.

Data Types: double

Output Arguments

collapse all

Time varying output signal, returned as a real finite vector.

Data Types: double

Sample time of the output signal, returned as a nonnegative vector of time values with discrete step size ts corresponding to the data in outputsignal in seconds.

Data Types: double

More About

collapse all

Output Signal Equation

timeresp function uses the variant of the following equation to calculate the output signal:

Y(n)=sum(C.*X(nDelay/ts))+D*U(nDelay/ts)

where,

X(n+1)=F*X(n)+G*U(n)X(1)=0F=exp(A*ts)G=(F1)./A

A— complex vector of poles of the rational function

C—complex vector of residues of the rational function

D—scalar value specifying direct feedthrough, and

Delay — delay time are properties of the rational function object, h. For more information, see rationalfit function.

Version History

Introduced in R2007a