AC Ultrasonic Speaker Design
You can generate the signal using your PC or whatever microprocessor you are using for the FFT.

You don't want a transformer.  

You want an amplifier.  You will have to find (or build) one intended to operate at the proper frequency range.



You don't want to try to do range finding using the inverse square law.  The results will be very inconsistent.

There are complete modules that do ultrasonic ranging.  They measure the time it takes for the echo to return.

They send a pulse of ultrasound, and measure the time until the echo is received. Since the speed of sound in air is fairly constant in normal temperatures, it is trivial to calculate distance from time.

You are probably better off using a complete module, and looking at the sample code, examples, and the driver software to see how to do this.