timeresp
Time response for rational objects
Description
[
computes the time response y
,t
,xf
] = timeresp(h
,inputsignal
,ts
)y
, sample time t
of
y
, and final states of the system xf
. The
function calculates the time response for a rational
, rfmodel.rational
, or
rationalfit
object
h
, using the time-varying input signal
inputsignal
at the specified sample time
ts
.
Examples
Time Response of Rational Object
Compute Time Response with Single Input Signal
Define an 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 with initial states set to 0
.
[y,t,xf]=timeresp(fit_data,InputSignal,SampleTime);
Compute Time Response with Segmented Input Signals
Segment the input signal into two parts.
Compute the time response of the first half of the input signal segment.
[y2(1:2000,1),t21,xf2]=timeresp(fit_data,InputSignal(1:2000),SampleTime);
Use the final states of the first half of the input signal segment xf2
as the initial states to compute the time response of the second half of the input signal segment.
[y2(2001:4100,1),t22,xf2]=timeresp(fit_data,InputSignal(2001:4100),SampleTime,xf2);
Plot Time Responses
Plot the time responses of the single and segmented input signals.
plot(t,y,':',t,y2,'--') legend({'Single Input Signal','Multiple or Segmented Input Signals'})
Input Arguments
inputsignal
— Time-varying input signal
real finite vector
Time-varying input signal, specified as a real finite vector.
Data Types: double
h
— Rational function object
rationalfit
object | rfmodel.rational
object | rational
object
Rational function object, specified as a rationalfit
,
rfmodel.rational
,
or a rational
object.
Data Types: double
Complex Number Support: Yes
ts
— Sample time of input signal
positive scalar integer
Sample time of the input signal, specified as a positive scalar integer in seconds.
Data Types: double
xo
— Initial states of system
0
(default) | real or complex column vector
Initial states of the system, specified as a real or complex column vector of length
L, where L is equal to
length(h.ComplexPoles/2)+length(h.RealPoles)
.
Data Types: double
Output Arguments
y
— Time-varying output signal
real finite vector
Time-varying output signal, returned as a real finite vector.
Data Types: double
xf
— Final states of system
real or complex column vector
Final states of the system that the function uses in computing the last value of the
y
, returned as a real or complex column vector of length
L, where L is equal to
length(h.ComplexPoles/2)+length(h.RealPoles)
.
Data Types: double
More About
Output Signal Equation
timeresp
function uses a variant of this equation
to calculate the output signal.
where
A
— Complex vector of poles of the rational function
C
— Complex vector of residues of the rational function
D
— Scalar value specifying direct feedthrough
Delay
— Delay time properties of the rational function object
h
. For more information, see rationalfit
function.
Version History
Introduced in R2007aR2022b: Compute time response of rational objects with initial states
To compute the time response of rational objects with the initial states, use xo
as one of the
input arguments to this function.
See Also
freqresp
| pwlresp
| rationalfit
| makepassive
| writeva
| ispassive
| rfmodel.rational
| rational
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)