I believe that Mach is measured at sea level.
Actually, Mach is measured at whatever altitude you're at. Sea Level isn't used as the "reference" for Mach, altitude is just a variable in its computation. However, aircraft pitot/static indicators are calibrated using a
standard day as a reference (more below). Mach 1 is simply the speed of sound at whatever pressure (usually altitude) and temperature (as well as density and viscosity) of the medium in which you're checking it. However, aircraft Mach indicators only use inputs for temperature and altitude (static pressure), as well as the requisite airspeed (pitot pressure) to determine Mach. Mostly for purposes of practicality as real time measurements of viscosity and density aren't possible with aircraft instrumentation, and the effects in air of those factors are negligible for aircraft stability purposes.
As far as the effects of breaking the sound barrier (on an aircraft or a human body), Mach 1 is Mach 1 no matter what altitude you're at. If an aircraft becomes unstable at certain Mach numbers, then the aircraft will experience instability at those Mach numbers regardless of the altitude. In other words, if an aircraft's mach limit is .86 (the Mach limit of a KC-135), and above that it can suffer control issues, then this will occur for this aircraft at aproximately 654 mph (568 knts.) True Airspeed at sea level, and at 567 mph (493 knts.) True Airspeed at 40,000 ft...as both of those speeds are .86 Mach for their specific altitude (and considering a
standard temperature for that altitude, which is actually variable and why it's compensated for realtime).
When people ask what the speed of sound is, the answer is usually the speed of sound at sea level. Or more specifically, the speed of sound at sea level on a
standard day. A standard day is defined by a specific value in pressure, density, temperature, and viscosity...though for aircraft usage, only pressure and temperature is actually used. A standard day pressure is 29.92" hg (inches of mercury) at Sea Level, and a temperature of 59
° F/15
° C. Technically, humidity plays a part also, affecting viscosity and density (as Umbran talked about), but as stated before, for practicality purposes aircraft Mach instrumentation only corrects for temperature and static pressure (altitude).
If I understand it (and I may not) the speed of sound would be a significantly higher velocity at very high altitudes, and at some point simply ceases to be measurable or meaningful in what increasingly approaches a vacuum.
You're right; the speed of sound is IIRC inversely proportional to the square root of the fluid density, so in very thin air it should be significantly higher than at sea level.
The speed of sound actually decreases as you climb in altitude.
The denser the medium, the faster sound travels. Sound actually travels faster through solid masses (like the Earth) than it does through air. However, energy is dispersed differently, limiting the range at which the sound can travel, and the attenuation of frequencies (which is why low frequencies travel through ground and water more effectively than high frequencies).
For example, the aproximate speed of sound in salt water (for a standard salinity, depth, and temperature), is about 1560 m/s (or just shy of 3,500 mph).
*I'm an Avionics Specialist.