What is kAccelerometerMinStep?

I watched the Accelerometer graph example in the iOS developers library, and I have a question about one of the variables used ...

#define kAccelerometerMinStep 0.02 

What is the accelerometer pitch? and what role does he have?

Here's how it is used in the Low Pass Filter ...

 -(void)addAcceleration:(UIAcceleration*)accel { double alpha = filterConstant; if(adaptive) { double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0); alpha = (1.0 - d) * filterConstant / kAccelerometerNoiseAttenuation + d * filterConstant; } x = accel.x * alpha + x * (1.0 - alpha); y = accel.y * alpha + y * (1.0 - alpha); z = accel.z * alpha + z * (1.0 - alpha); } 

And this is how it is used in the High Pass Filter ...

 -(void)addAcceleration:(UIAcceleration*)accel { double alpha = filterConstant; if(adaptive) { double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0); alpha = d * filterConstant / kAccelerometerNoiseAttenuation + (1.0 - d) * filterConstant; } x = alpha * (x + accel.x - lastX); y = alpha * (y + accel.y - lastY); z = alpha * (z + accel.z - lastZ); lastX = accel.x; lastY = accel.y; lastZ = accel.z; } 

If someone can tell me what the minimum step is responsible for, I would be very grateful ...

I would like to capture accelerations in the range from 0.05 to 2.00 g with a frequency response of 0.25-2.50 Hz

Thanks.

+4
source share

Source: https://habr.com/ru/post/1347403/


All Articles