signal drift when integrating accelometer data to velocity
조회 수: 1 (최근 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에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!