Main Content

# timeresp

Time response for rational object and `rationalfit` function object

## Syntax

``[outputsignal,t] = timeresp(h,inputsignal,ts)``

## 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

Input signal,

Example:

Data Types: `double`
Complex Number Support: Yes

Rational function object, specified as a `rationalfit` object handle.

Example:

Data Types: `double`
Complex Number Support: Yes

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

Example:

Data Types: `double`

## Output Arguments

collapse all

Output signal,

Example:

Data Types: `double`
Complex Number Support: Yes

Sample time of the output signal, returned as a positive scalar integer in seconds.

Example:

Data Types: `double`

## More About

collapse all

### Output Signal Equation

RF Toolbox™ uses the following equation to calculate the output signal:

`$Y\left(n\right)=sum\left(C.*X\left(n-Delay/ts\right)\right)+D*U\left(n-Delay/ts\right)$`

where,

`$\begin{array}{l}X\left(n+1\right)=F*X\left(n\right)+G*U\left(n\right)\\ X\left(1\right)=0\\ F=\mathrm{exp}\left(A*ts\right)\\ G=\left(F-1\right)./A\end{array}$`

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

## See Also

Introduced in R2007a

Download ebook