在系統識別工具箱中對不規則採樣數據的支持是非常有限的。系統識別工具箱的許多功能都需要定期採樣數據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下測量輸入和輸出數據通常很好(但這可能取決於您的應用)。
你不是真的提供了很多關於你試圖建模的數據的信息...... – Trogdor
嗯,我不認爲數據的類型是重要的,但我的輸入數據是一個4 PWM (脈衝寬度調製)在每次採樣時發送給4個電機,並且我的輸出數據是描述四軸飛行器姿態的每個採樣時刻的歐拉角集。 –