How can you do a baseline shift on an acceleration-time history data file?

This is easy to do in DPlot, but we are finding that there is some sort of wierd single to double precision conversion operation that tends to corrupt the time steps. I'm assuming Matlab can do a baseline shift without corrupting the data. Is there a built-in function in Matlab? Some simple code that can be used in a script file?

2 commentaires

Can you be more specific on what you mean by baseline shift? Do you want to change just the axis limits on the plot, or do you mean actually change the data values?
The baseline shifts I'm familiar with generally look at an average offset of the accelerometer trace prior to the start of the event, which is usually set as t=0. That average value is then applied to the entire trace as a correction, so yes, it would change the data values.

Connectez-vous pour commenter.

Réponses (1)

Wayne King
Wayne King le 7 Fév 2013
Modifié(e) : Wayne King le 7 Fév 2013
You can then just do the following. I'll assume that X is your data in the MATLAB workspace
X = 5+randn(200,1);
Y = X-X(1);
The above code subtracts the value of X at t=0 (the first value) from all elements of the signal. This has the effect that Y (the new signal) is equal to 0 at t=0.
Another way that is better in many contexts is to subtract the overall mean from each element of the signal.
X = 5+randn(200,1);
Y = detrend(X,0);
% OR
Y = X-mean(X);

Question posée :

H.
le 6 Fév 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by