|
老师,我用了vold-kalman1进行了滤波,y是我构造的复合信号,x是我滤波后的信号,f_n是转速信号。
老感觉不对,但是具体不知道哪有问题,老师能不能大概给我指导一下?
close all
clear all
clc
N = 1000;
fs = 1000;
T = 1;
dt = 1/fs;
t = (0:dt:(T-dt))';
A1 = (7/10)*(t/fs)+3;
A2 = t/fs;
A3 = t/fs + 5;
f_n = 20/(T-dt)*t;
w_i = 2*pi*f_n;
x1 = A1.*sin(cumsum(w_i)*dt);
x2 = A2.*sin(3*cumsum(w_i)*dt);
x3 = A3.*sin(5*cumsum(w_i)*dt);
y = x1+x2+x3;
figure()
subplot(411),plot(t,x1);
subplot(412),plot(t,x2);
subplot(413),plot(t,x3);
subplot(414),plot(t,y);
r = 1;
filtord = 1;
% x = MyVoldKalman2(y,dt,f_n,r,filtord); % vold-2
x = MyVoldKalman1(y,dt,f_n,r); % vold-1
figure()
plot(t,x) |
|