Low-Pass filter for unity compass

I am developing an Geo location application in unity. i am trying to figure out the north direction, unity compass provides the directional data but it is very noisy.. can anyone help me with the Low Pass filter for compass data.