How can you do a baseline shift on an acceleration-time history data file?
Mostrar comentarios más antiguos
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 comentarios
Wayne King
el 7 de Feb. de 2013
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?
H.
el 7 de Feb. de 2013
Respuestas (1)
Wayne King
el 7 de Feb. de 2013
Editada: Wayne King
el 7 de Feb. de 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);
Categorías
Más información sobre Tables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!