I'm building a inductive vehicle loop detector. By measuring the frequency of a LC-oscillator where the cars will pass over the inductor of the LC-Oscillator.
If the cars pass over the inductor the frequency will change over time according to one of the following profiles.
The frequency will also slightly change / drift based on environmental variables: like temperature, humidity or other variances in the environment of the loop. To filter these last variations out, I used running average and std_variation based on: This post/comment on stack exchange. And was planning to detect vehicles when the frequency would go too many standard deviations away from the average.
The measurements made when there is a vehicle present shouldn't be added to the average calculation. This is easy to do when a certain threshold is passed.
But the problem is when a car is approaching the frequency will start to change but hasn't yet passed the threshold so these samples are added to the statistics. When a car approaches very slowly the standard deviation will be changed so much that the car will never be detected.
What solutions / alternatives / suggestions do you have to detect approaching cars and discard the values from the statistics for the reference empty loop.
Thanks in advance