I was wondering which waveform suits the best for ultrasound sensing. For instance, if I am going to detect distances to the objects, does it matter if I send sawtooth, square wave or pure sine wave? It is really interesting how will it affect the analysis of the received signal, might there be a possibility that some kind of waves would get less resistance in air, or would they reflect better and etc. I would appreciate your help on the topic.
More often than not you send as narrow a square pulse as possible, be it sonar (the 'ping'), ultrasound or radar. You want to keep ON time to a minimum, and OFF time to a maximum value that accounts for maximum range to be measured, so you can switch to receive mode quickly. The return time gives you basic distance, and return echo's can establish an objects shape and size (sonar and radar).
Sound travels at about 900 feet/second in open air, so 40KHZ ultrasound has a minimum distance of about 3cm. Long distance travel causes ultrasound to weaken and distort from echos and air density, so unlike radar it has a very limited range, about 30 to 100 feet. Arrays of ultrasound emitters can travel hundreds of feet, often used as animal repellers.
Ultrasound ranging modules are available from many sources. Check out Mouser, Newark, Acroname, Arduino. Prices range from $18 to $45 USD. Combine these with an MPU or Arduino or Raspberry Pi and some software and you have a complete ultrasound ranger.