signal drift when integrating accelometer data to velocity
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
I am generating some synthetic accelerometer data with noise to perform a modal analysis. I have used a sine wave added noise with a random number added to the amplitude value. I am now trying to "clean" out the noise with a low pass filter and then integrate for velocity, but I am still getting some drift in my velocity wave. I have tried detrend, and that doesn't seem to work. Please see my attached code. Is there something else I can do with my filter? also, is there a better way of generating my accerometer data?
Thanks,
function output=signalgen(a, omega,t)
f=omega*2*pi;
r=normrnd(-1,1,[1,length(t)]);
output=(a+(r./100)).*sin(f.*t);
end
a=input('What is the amplitude of the acceleration? ');
omega=input(' Please specify input frequency: ');
t=0:0.05:100;
%% Initial Signal Generation
%this section generates initial accelometer signals for synthetic data
y1=signalgen(a, omega, t);
%% Signal Cleaning
d = designfilt('lowpassiir','FilterOrder',2, ...
'HalfPowerFrequency',0.15,'DesignMethod','butter');
w1= filtfilt(d, y1);
subplot(2,1,1)
plot(t,w1)
%% integration from acceleration to displacement
q1=cumsum(w1);
q2=detrend(q1);
subplot(2,1,2)
plot(t,q2)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!