Sound analyizing

What Arduino do you have?

In order to see 20KHz you need to sample at least at 40KHz and preferably much higher.

The project will require you know about FFT and windowing functions applied to the input waveform. I don’t think it is something you can do with a Uno class Arduino.