Can my integration code for an accelerometer data work for a Square wave?

조회 수: 4 (최근 30일)
I have a code written to integrate an accelerometer data to displacement. this code integrates the signal.
The code includes a butterworth high pass filter and the "cumtrapz" integration code.
Applying the code to a square wave, the wave becomes distorted. Does it mean my code is not good enough or the square wave will always be distorted by the filter.
Thanks in advance.

채택된 답변

Dr. Seis
Dr. Seis 2012년 5월 11일
Instead of trying to convert using your code, try mine located here:
Say your acceleration data is called "square_acceleration_data", then (once you save my iomega.m file in a location Matlab can find it, like your Matlab home directory) you would produce your displacements like this:
square_displacement_data = iomega(square_acceleration_data,dt,3,1);
where "dt" is equal to your time increment (i.e., 1/Fs or 1 over your sampling frequency).
Example:
  댓글 수: 2
kunle
kunle 2012년 5월 14일
Thanks Elige and Walter for your responses. Elige, thanks for you iomega.m program but it only works for my square wave. When I apply it to the acceleration data, it gives a 'U' shaped curve which shouldn't be.
Dr. Seis
Dr. Seis 2012년 5월 14일
Can you post a picture of the acceleration data with the resulting displacement data? It might be necessary to run a high-pass filter on the acceleration data to avoid introducing low-frequency noise into the displacement data.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 11일
It could mean both, but Yes, a square wave will always be distorted by any frequency filter.
square waves (and all other kinds of waves with straight edges... other than the constant signal of course) require infinite signal bandwidth to represent properly. Remove any frequency from that bandwidth (by way of filtering) and the square wave will be distorted. You often get "overshoot" on the leading and trailing edges as well.

카테고리

Help CenterFile Exchange에서 Historical Contests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by