Main Content

nkshift

Shift data sequences

Syntax

Datas = nkshift(Data,nk)
Datas = nkshift(___,Name,Value)

Description

Data contains time-domain or frequency-domain data that can be in the form of a timetable, comma-separated pair of numeric matrices containing the inputs and outputs, or an iddata object.

nk is a row vector with the same length as the number of input channels in Data.

Name-value pair arguments specify additional model arguments. The available arguments consist of:

  • InputName and OutputName are the input and output channel names. Use these arguments especially when Data is a timetable that has more variables than you want to use or when the input and output variables are intermixed. Also use OutputName to identify the output channels when the timetable contains more than one output variable. Otherwise, the software interprets only the last variable an output channel.

    For example, specify the input and output signal variable names using Datas = nkshift(Data,'InputName',["u1","u3"],'OutputName',"y1")You can use this syntax with any of the previous input-argument combinations.

  • Ts and TimeUnit provide the sample time and time units.

Datas, which has the same form as Data, contains data in which the input channels in Data have been shifted according to nk. A positive value of nk(ku) means that input channel number ku is delayed nk(ku) samples.

nkshift supports both frequency- and time-domain data. For frequency-domain data it multiplies with einkωT to obtain the same effect as shifting in the time domain. For continuous-time frequency-domain data (Ts = 0), nk should be interpreted as the shift in seconds.

nkshift lives in symbiosis with the InputDelay property of linear identified models:

m1 = ssest(dat,4,'InputDelay',nk) 

is related to

m2 = ssest(nkshift(dat,nk),4);

such that m1 and m2 are the same models, but m1 stores the delay information and uses this information when computing the frequency response, for example. When using m2, the delay value must be accounted for separately when computing time and frequency responses.

Version History

Introduced before R2006a

expand all