for measuring resonant frequency