timeresp

Time response for rational object and rationalfit function object

Syntax

[y,t] = timeresp(h,u,ts)

Description

[y,t] = timeresp(h,u,ts) computes the output signal, y, that the rational function object, h, produces in response to the given input signal, u.

The input h is the handle of a rational function object returned by rationalfit. ts is a positive scalar value that specifies the sample time of the input signal.

The output y is the output signal. RF Toolbox™ software computes the value of the signal at the time samples in the vector t using the following equation.

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

and A, C, D, and Delay are properties of the rational function object, h.

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);
Introduced in R2007a