Compression refers to the region of a longitudinal wave where the particles are closest to each other, while rarefaction refers to the region of a longitudinal wave where the particles are farthest apart from each other. This basic foundation of a longitudinal wave, including compression and rarefaction, differs from other waves containing crests and troughs.
Sound waves can be classified as mechanical, pressure or longitudinal waves. When sound waves are transferred through a medium, which can be any material via particle-to-particle interaction, the wave is classified as mechanical. Sound waves can also consist of high- and low-pressure patterns transferring through a medium; in these instances, the sound wave is classified as a pressure wave. However, these two classifications are typically marked by crests and troughs throughout the wave, rather than compression and rarefaction.
Longitudinal waves often result from sound moving through air specifically. Particles in the air are affected in a direction that is parallel with the direction in which the sound energy is moving. This difference in the particles' reactions when a sound energy wave moves through the air results in compression and rarefaction, rather than crests and troughs.
The source of the sound is irrelevant to the type of wave produced. Instead, the type of sound wave depends more heavily on the medium through which the sound wave travels. If the sound wave travels through the air, it will result in a longitudinal sound wave, marked by compression and rarefaction.