public float getHalfWave ( ) throws IOException { while ( true ) { int sample = getSample ( ) ; if ( frequencyCounter . update ( sample ) ) { return frequencyCounter . getFrequency ( ) ; } } }
Reads one half - wave and returns frequency