  Due to its ubiquitous and contact-free nature, the use of WiFi infrastructure
for performing sensing tasks has tremendous potential. However, the channel
state information (CSI) measured by a WiFi receiver suffers from errors in both
its gain and phase, which can significantly hinder sensing tasks. By analyzing
these errors from different WiFi receivers, a mathematical model for these gain
and phase errors is developed in this work. Based on these models, several
theoretically justified preprocessing algorithms for correcting such errors at
a receiver and, thus, obtaining clean CSI are presented. Simulation results
show that at typical system parameters, the developed algorithms for cleaning
CSI can reduce noise by $40$% and $200$%, respectively, compared to baseline
methods for gain correction and phase correction, without significantly
impacting computational cost. The superiority of the proposed methods is also
validated in a real-world test bed for respiration rate monitoring (an example
sensing task), where they improve the estimation signal-to-noise ratio by $20$%
compared to baseline methods.
