Audio file waveform

The calculator displays the waveform of the input audio file fragment.

Use this calculator to view an audio file waveform. The waveform is a shape of audio signal as a function of time. The calculator accepts wave audio files in PCM format (raw or a/mu-law encoded) and displays its waveform as a vector graph. The calculator can display multi channel (stereo, quadro, etc.) audio waveform.

PLANETCALC, Audio file waveform

Audio file waveform

Wave file
  • Drag files here
Digits after the decimal point: 3
File format

Waveform draw algorithm

PCM audio data is stored as a sequence of signal amplitude samples recorded at regular intervals. One second of the low quality 8kHz audio consists of 8000 amplitude samples. To display every point of this fragment as is you need at least 8000-pixel wide display. I believe that such a screen resolution is still rare in 2020. Therefore, we need an algorithm to reduce the visual representation of the waveform.
The calculator uses root mean square (RMS) algorithm to represent a sample set as a single line on the waveform graph. Brief description of the drawing algorithm:

  • Determine number of graph width points P (change by settings switch in the calculator)
  • Determine number of samples per point S=T/P, where T - total number of samples
  • For every point calculate RMS:
    R=\sqrt{\sum_{n=1}^{S} s(n)^2}
    where s(n) - is n-th sample of a given point
  • For every point draw a vertical line from -R to R

PCM file format nuances

Audio amplitude samples is stored either as float or integer values in PCM format. The calculator converts the integer amplitudes to float ones in range (-1...1) to represent the signal waveform on the graph uniformly. Two types of integer data can be stored in PCM format. If the integer sample size less or equal 8 bit (one byte) the data is stored as unsigned value, otherwise (more than 8 bit) it's two's complement signed. The calculator transforms 8-bit integer data to float in this way: (s(n)-128)/128. The greater integer data (16, 24 or 32-bits long) is converted to float as s(n)/|int_min|. |int_min| equals to 32768; 8388608 or 2147483648 for 16, 24 or 32-bit integer respectively.

URL copied to clipboard
Creative Commons Attribution/Share-Alike License 3.0 (Unported) PLANETCALC, Audio file waveform