【问题标题】:System Identification with nonuniform (irregular) sampled data具有非均匀(不规则)采样数据的系统识别
【发布时间】:2016-09-27 13:52:46
【问题描述】:

我正在尝试使用 MATLAB 的系统识别工具箱 (App) 和命令行来识别我的四轴飞行器的型号。我的输入和输出信号都是非均匀采样,具体来说,连续测量之间的采样时间在整个实验过程中不是恒定的。

我发现可以使用以下方法在 MATLAB 上创建非均匀数据集:

FlightData = iddata(inputs, outputs, [],'SamplingInstants', time, 'Name', dataName);

其中time 包含非均匀采样时间向量。但是,我在 MATLAB 上找不到任何接受这种非均匀数据的线性或非线性模型。

如果有人可以提供任何提示,我将不胜感激。

【问题讨论】:

  • 您并没有真正提供有关您尝试建模的数据的太多信息...
  • 好吧,我认为数据类型并不重要,但我的输入数据是每次采样时发送到 4 个电机的 4 个 PWM(脉冲宽度调制)数组,并且我的输出数据是描述四轴飞行器姿态的每个采样时间的一组欧拉角。

标签: matlab sampling system-identification


【解决方案1】:

系统识别工具箱对不规则采样数据的支持相当有限。 System Identification Toolbox 的许多功能需要定期采样数据see this link

根据您对iddata() 的使用,我猜您的输入和输出数据是在同一时刻成对测量的,但相邻样本之间的时间跨度不规则。

在这种情况下,您可以使用一些(线性)插值,例如 interp1。这可能会在估计中引入一些错误,但这是一种简单而快速的方法。只需定义具有规则时间步长的新时间网格并对其进行插值即可。

% create some dummy data
time = rand(20,1);                                  % irregular sampled measurements
input = sin( 2*pi*time);                            % some input signal
output = cos( 2*pi*time );                          % some output signal

% define new time vector and interpolate input and output data
Ts = 0.01;                                          % new sampling time in seconds
newTime = min(time) : Ts : max(time);               % new time vector
inputInterp = interp1( time, input, newTime  )      % interpolated  input data
outputInterp = interp1( time, output, newTime  )    % interpolated  output data

% lets see what just happend
figure
plot( time,input,'o'), hold on
plot(time,output,'ro');

plot( newTime, inputInterp, 'x')
plot( newTime, outputInterp, 'rx')

legend({'Original Input', 'Original Output', 'Interpolated Input', 'Interpolated Output'})

应该可以解决问题。

如果您的(原始)采样频率大于相关动态的频率,则误差应该很小。四轴飞行器的(刚体)动力学约为 1 Hz,因此以 50 或 100 Hz 测量输入和输出数据通常很好(但这可能取决于您的应用)。

【讨论】:

    猜你喜欢
    • 2016-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    • 2013-07-15
    • 1970-01-01
    • 2019-09-16
    • 2017-07-12
    相关资源
    最近更新 更多