Interactive computer science audio lab

Audio Frequency Lab

Hear how frequency changes pitch, see how amplitude changes waveform height, and test what happens when audio is sampled too slowly.

Classroom safety: Start with your speakers or headphones turned down. The sound controls are deliberately limited, but frequency changes can still feel sharp.
440 Hz

Higher frequency means a higher pitch because the wave cycles more times each second.

0.50

Greater amplitude makes the wave taller and the sound louder. It does not change the pitch.

8000 Hz

The sample rate is how many measurements are taken every second. Too few samples can cause aliasing.

Different wave shapes have the same frequency but a different tone quality.

Ready. Press Play tone to start.

Frequency and amplitude

Watch the same sound wave over a short slice of time.

Sampling view

The dots show the measurements a computer would keep.

Wave period2.27 ms
Nyquist limit4000 Hz
Samples per cycle18.2
Sampling resultSafe

This sample rate is more than twice the frequency, so the sine wave can be represented without aliasing.

Frequency

Frequency is measured in hertz (Hz). A 440 Hz tone completes 440 cycles every second.

Amplitude

Amplitude is the size of the vibration. In digital audio, it is represented by the sample value.

Sampling

Sampling converts a continuous wave into a list of measurements. The Nyquist idea says the sample rate should be more than twice the highest frequency you need to capture.

Quick check

1. Which slider changes the pitch of the sound?

2. What can happen when the sample rate is too low?

Choose an answer to check your understanding.

Teacher notes and lesson ideas
  • Ask learners to set the same amplitude and compare 220 Hz, 440 Hz and 880 Hz.
  • Ask learners to keep frequency constant, change amplitude, and explain why the pitch stays the same.
  • Use Aliasing challenge, then ask why the sampled dots no longer describe the original wave reliably.
  • Extension: connect the sample rate slider to common rates such as 8 kHz for telephony and 44.1 kHz for CD audio.