As soon as the value is equal to 1 the vibration spectrum is saved. The record is saved exactly at the moment when function will change it's state from 0 to 1.