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

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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Wayne King
Wayne King 2013년 2월 7일
편집: Wayne King 2013년 2월 7일
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);

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

H.
2013년 2월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by