How to correct the recording of a daamaged accelerometer in earthquake analysis
Show older comments
Hello everyone,
I have the recording of two accelerometers but it turned out that one of them did not work properly and the recording is messed up (See photo, The two recordings should be the same). However I think if processed well I can recover the lost acclerogram. Does anyone have an idea how I can proceed. I have attached the recordings.
Thank you in advance

2 Comments
Hi @charbel
This is an attempt to plot the results. As I do not have expertise in seismology, I cannot definitively determine which output is preferable and which is less so. However, a typical accelerogram would be expected to resemble the first (blue) trace.
load('acceleration.mat');
t = acceleration(:,1); % time
dat1= acceleration(:,2); % blue data
dat2= acceleration(:,3); % red data
subplot(211)
plot(t, dat1, 'color', "#0072BD"), grid on
xlim([t(1), t(end)]), ylim([-1, 2]), xlabel('Time'), ylabel('Acc / [cm/s^{2}]')
title('Accelerogram 1')
subplot(212)
plot(t, dat2, 'color', "#D95319"), grid on
xlim([t(1), t(end)]), ylim([-1, 2]), xlabel('Time'), ylabel('Acc / [cm/s^{2}]')
title('Accelerogram 2')
charbel
on 11 Jun 2024
Accepted Answer
More Answers (1)
Hello,
A possible solution can be to remove the mean over a small interval from the existing data to change the data to be centered around zero or around the mean of the correct data. It can be done similar to the code shown below:
load("acceleration.mat");
plot(acceleration(:,1),acceleration(:,2));
hold on
plot(acceleration(:,1),acceleration(:,3));
hold off
n=acceleration(:,3);
for i=1:10:length(acceleration(:,3))-9
n(i:i+9)=acceleration(i:i+9,3)-mean(acceleration(i:i+9,3))+mean(acceleration(:,2));
end
plot(acceleration(:,1),acceleration(:,2));
hold on
plot(acceleration(:,1),n,'g');
hold off
legend(["Accelogram 1","Corrected Accelogram 2"]);
The number of datapoints to be taken at a time for "mean" can be changed based on the requirement.
2 Comments
Image Analyst
on 11 Jun 2024
To avoid changing the (probably) "good" data before the sensor went bad, you can start the correction just where it starts to go bad, like around x=50 or so, instead of at the first index.
charbel
on 11 Jun 2024
Categories
Find more on Earthquake Engineering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








