Sanyanggae LogoSanyanggae

📱 Mobile & App Dev

Taller peaks or closer peaks? Reading an audio waveform

Compare three sine waves over the same 20 milliseconds. Measure their peaks and periods, distinguish digital amplitude, frequency and sample rate, and learn which scales to check in an audio editor.

사냥개 (Sanyanggae)Published Updated 9 min read

This is a translation of the Korean original. Korean original · Translation review: AI review

Three rows of sine waves. The top shows two cycles, the middle shows two at twice the height, and the bottom shows four at the same height as the top.
An explanatory diagram by Sanyanggae. Each row spans 20 milliseconds. Relative to the top signal, only amplitude doubles in the middle, and only frequency doubles at the bottom.

1. Compare equal stretches of time

Trace the top curve from the left. It leaves the center line, passes over a crest and down into a trough, then crosses the center line going up again. That is one cycle. The movement repeats once before the right edge. In the middle row the crests are taller and the troughs deeper, yet a cycle ends in the same place. When the bottom row finishes its first cycle, the top trace is only halfway through its own. Which two rows you compare depends on what you want to find out.

Each row spans 20 milliseconds from left to right. Two graphs of equal width on paper need not cover equal times, so check the time scale first in an editor. The vertical scale is linear and identical in all three rows. Each row has its own zero line. The three baselines sit at different heights on the page to make the comparison legible. That arrangement says nothing about when the signals were recorded or which has the largest value.

2. From center to crest and from trough to crest

Find the first crest in each of the upper two rows and measure vertically from its own center line. If the top crest is one division high, the middle one is two. The depth of each trough increases in the same proportion. The two curves still cross zero at exactly the same times. To make the middle signal, multiply every instantaneous value of the top signal by two. Positive values grow, negative ones become more negative, and twice zero is still zero. The timing is untouched, so the sound repeats at the same rate.

When you record an amplitude, write down where your measurement begins and ends. Suppose the top sine wave ranges from +0.25 to −0.25 about zero. Its peak amplitude is 0.25, whereas the difference from minimum to maximum is 0.50. The middle row has a peak amplitude of 0.50 and a peak-to-peak excursion of 1.00. Compare the whole height of one row with half the height of the other and the two numbers can match by accident. These are digital values with full scale set to 1. They are not measurements of air pressure in pascals at the microphone.

3. Time a return in the same direction

Set height aside and read horizontally. Two full cycles of the upper signal fit in 20 milliseconds, so the period is 10 milliseconds. In seconds that is 0.010, whose reciprocal is 100 cycles per second, or 100 hertz. Four cycles of the bottom signal fit in the same span. Its period is 5 milliseconds and its frequency is 200 hertz. The top and bottom have equally high crests but take different times to complete a cycle. The middle and top have different heights but the same period and frequency.

Measure between consecutive crests or between consecutive zero crossings going in the same direction. A sine wave crosses zero twice per cycle. Taking an upward crossing and the next downward crossing as the endpoints of a cycle doubles your frequency estimate. When using crests, remember that three points, from the first crest to the third, enclose only two intervals. Measuring several cycles at once reduces the effect of a small error in reading the scale. Divide your total time by the number of complete intervals to get one period.

4. What changes when you zoom or sample?

Vertical zoom can make the same recording fill the track. When comparing an original with a copy, check that both tracks use the same vertical range and that one has not been switched to a logarithmic display. Horizontal zoom can be just as misleading. Shorten the visible interval from 20 to 10 milliseconds and the top trace shows one cycle instead of two, with no change in playback speed or pitch. Screenshots of the same file at different zoom settings provide little basis for comparing amplitude or frequency without the scales.

Sample rate is also measured in hertz but counts something else. A file sampled at 48,000 hertz has 48,000 samples per second in each channel. A 20-millisecond interval thus lasts 960 sample intervals. In the same file, a 100-hertz pure tone uses 480 sample intervals per cycle, and a 200-hertz tone uses 240. Seeing more cycles in the bottom row does not mean the recorder sampled more often. Zoom far out and an editor can summarize many samples in a single screen pixel. Counting the outline of this broad band will not reliably give a period.

5. Can peak height tell you how loud it sounds?

Doubling peak amplitude against the same digital reference changes level by about 6 decibels. With full scale as the reference, the example peaks of 0.25 and 0.50 correspond to about −12 dBFS and −6 dBFS. Both are negative, yet the middle trace has the higher level. The values say how far below digital full scale each peak lies. They do not give the sound level measured in a room. Lower the playback volume or change headphones and the sound reaching your ears changes while the file's samples stay the same. Even under identical conditions you cannot translate a ratio of peak heights directly into a ratio of perceived loudness.

Try the method on one recorded syllable. Zoom out to find its beginning and end, then zoom in horizontally on a fairly steady stretch in the middle until you see several neighboring patterns. If several crests appear, the nearest two tips need not mark the beginnings of successive cycles. In a complex signal, look for recurrence of the whole pattern. A breathy stretch may have no clear repetition, in which case assigning it a single frequency would be misleading. Use a spectrum to examine how its components are distributed in frequency. Note the time span, vertical scale and two landmarks you used alongside the result so someone else can retrace your reading.

Sources and further reading

This article explains information from public sources. Citing an organization does not imply its review or endorsement.

About the publisher and contact

Related articles