What you might have is that the air might disperse the wave so it gets distorted but still with the same components https://en.wikipedia.org/wiki/Acoustic_dispersion
What you might have is that the air might disperse the wave so it gets distorted but still with the same components https://en.wikipedia.org/wiki/Acoustic_dispersion
Since air pressure does not typically produce a height difference in the atmosphere, standard sounds in air are not subject to dispersion and act very differently from water. There is obviously still a limit to the rise/fall time of a square wave, when the transition is more like a shockwave front, but that's a very square wave.
Yes it's easy to think they behave the same, but they don't.
(below is the original 440Hz square wave; above is the recorded sound)
The recorded waveform looks nothing like the original, and it sounds very different too: the original is much harsher, although the pitch sounds exactly the same, as expected.
Might be my crappy microphone? Or maybe the sound is being filtered somewhere along the way?
My best guess for the large attack showing up there is not effects from the microphone, DAC, amp, or anything but the actual speaker. Good audio measurements are hard to come by thanks to all the snake oil, but square wave measurements are common when there is data. The physical models of transducers aren’t trivial, but in a single broad stroke the answer is “physics” and “spring-mass-damper”.
https://www.innerfidelity.com/images/AKGK701.pdf
The decay is expected, as the pressure around the microphone can only temporarily increase before the pressure wave disperses into the room. As an extreme example, if you turned an entire wall into a speaker and played a square wave, you would be able to make a much more square shaped waveform. There’s no replacement for displacement baby (see: subwoofers). If you want a more square waveform, try using a headphone pushed right up to the mic and going to a higher frequency (like 1 kHz).
Edit: If you want to skip the trip down the rabbit hole: I think the end-all for audio quality are sealed in-ear monitors (IEMs). Low group delay from short distance from transducer to eardrum, and sealed enclosure for good bass response (see: square shaped low frequency square waves).
The point of the experiment is to demonstrate that sound waves in air are not at all like water waves and sonic square waves do, in fact, exist.
But it is true: if there was a plate that could move like a square it would not mean all air in the front and back of it would also move like it.
The air compression would move like a sine instead of a square.