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
Wayne King
2013년 2월 7일
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.
2013년 2월 7일
답변 (1개)
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에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!