# High Pass Filter on Gyroscope Data

Does it make sense to apply high pass filter over gyroscope data coming from an IMU? I am using MEMSENSE nano IMU and I am getting rotation angle rates from it. Earlier as I tried to directly integrate the data to get the rotation angles I did not get anything making sense. I am doing a random motion experiment to find out if the device is working or not. I start moving the IMU from rest and after rotating it randomly I bring it back to rest. Without this high pass filtering, my output looked like this:

After that I don't know why I applied that but it is giving me perfect results.

By High Pass Filter I mean:

• During the sample collection from gyroscope of IMU, calculate the average value of the rotation rate
• subtract this mean from all the samples

Following are my results:

• I suppose that would depend on what you're doing with the information. There are probably more effective ways to remove a baseline offset, if that's what you're trying to do. Commented Jun 4, 2014 at 19:44
• At the moment I'm totally bamboozled by your explanation of what you are doing precisely, what the input data represents (and precisely is numerically) and what you believe the output data represents. Just saying. BTW is it anything to do with EE? IMU? Commented Jun 4, 2014 at 20:06
• @Andy aka..Yes it is. I am using MEMSENSE nano IMU and I am getting rotation angle rates from it. Commented Jun 4, 2014 at 20:35
• @ScottSeidman, kindly check the question again i just updated it. I am not working on a specific application. I just want to check if i can get the correct angles from it. I have not mounted it over anything. its freestyle! Commented Jun 4, 2014 at 20:41

Uner -

No. You are fooling yourself. If you high-pass as you are doing, any final angle will decay to zero. Try it yourself: step your gyro away from zero on any axis and stay there. Watch what happens to your high-passed output - it will drop back to zero.

If what you are doing is simply to demonstrate that you are reading the gyro correctly, confine your movements to one axis only. Try putting in on a level surface and rotating it horizontally, then tip it in the pitch axis.

If you are going to do anything more involved, you must learn to do angle transformations. I know you don't want to believe this, but until you do your complex movements will continue to make no sense to you.

• No, the velocity, not the angle, would go to zero Commented Jun 5, 2014 at 1:56
• Nope. High pass, by definition, allows no DC. So any angle change which results in a DC output will gradually drop to zero. As happened with his data. Please pay attention to his figures. Commented Jun 5, 2014 at 2:13
• @WhatRoughBeast Let me check that for you. Right now, however i have my results for one axis and they are perfect. what i do is, i move around in one axis and come back and thats what the data shows: drive.google.com/file/d/0B2w3mmBOvQsIS3lpMTVGTi1ER28/… Commented Jun 5, 2014 at 2:20
• Gyroscope reports angular velocity, not position. High passing velocity will brign DC velocity to zero. The integral should not go to zero. He says he's filtering rate. His figures show otherwise. Could be he's actually plotting rate with poorly labelled axes. Commented Jun 5, 2014 at 2:20
• @UmerHuzaifa - Right. Congratulations. Your IMU is working perfectly. Each axis is performing as it should. Not only that, if moving one axis produces no output on the other two, you know that the cross-axis terms are zero. And you can't ask for more than that. But. If you want to show the results of complex rotations you will need to learn rotation transformations. No matter how much you don't want to. And why do you claim your 2nd figure is correct? Did you really shake your gyros around and then gradually bring them back to their original position? Commented Jun 5, 2014 at 5:41