The simplest filter, that many of us will have already used, is to pause our code, take about 10 quick readings from our sensor and then calculate the mean ... although wind direction is slightly ...
while a wind vane measures wind direction. The vane always points in the direction that the wind is coming from and reports an analog voltage signal directly proportional to the azimuth angle.