Explanation by Jon Jeffords of Hartford WI:

the way it was explained to me,
the Katech whistler is basically an acoustic measuring device that functions much like when you blow air over the top of a beer bottle.

Oversimplified, as the whistler blows air over the the spark plug hole while the piston is at TDC, it measures the resulting natural frequency of the air volume resonating in the combustion chamber. Knowing the air temperature, the Whistler calculates combustion chamber volume at TDC. Knowing the engine's displacement (bore & stroke) and number of cylinders, the Whistler can then calculate compression ratio.