Week 11, 31 March

I added a software filter into my firmware design.

It is called Moving Average algorithm. Basically, it is a technique used to analyze time series data. It serves as a software low pass filter in signal processing, aims at filtering the signal spikes in analog signal.

moving_avg_algo

Moving Average Algorithm

Basically, all the data is arranged in series. By using a window size of 10, the raw sensor data is fed into the array, and the average of 9 previous data and current data is calculated and output to the PIC.

If a signal spike occurs in the sensor output as shown in the diagram above, the averaged sensor output is only affect by 0.3. Thus it will not create a spike in the control signal. The sampling frequency is not affected because all the data is moved forward in the array every time the air pressure is sampled. The two diagrams below show the difference between the raw data and the processed data.

raw_data

Raw Data

processed_data

Processed Data

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License