Sound becomes a signal
A tuning fork rings. Its prongs swing 440 times a second and push the air, so the air pressure near it rises and falls. A quantity that changes and carries information is a signal.
A microphone turns air pressure into a voltage on a wire. More pressure, more voltage. The shape stays the same; only the kind of quantity changes. We call this voltage x(t) and draw it as it arrives.
A function of time
Give the signal a time and it gives back one value. At t = 0.5 ms the voltage is x(0.5 ms) = 9.82 mV. Time is the input (the independent variable); the voltage is the output.
This wave peaks at 10 mV: its amplitude. It repeats every T = 1/440 s = 2.27 ms: its period. Repeats per second are the frequency, f = 1/T = 440 Hz. We hear frequency as pitch.
Between any two instants there is another, and x(t) has a value at each one. A signal defined for every real time t is a continuous-time signal. The voltage on the wire is one.
From smooth to numbers
A converter (ADC) measures the voltage 8000 times a second: once every Ts = 1/8000 s = 125 µs. Each reading is a sample: x[n] = x(n·Ts). So x[4] = x(0.5 ms) = 9.82 mV.
In 5 ms the converter takes 40 samples. Now the signal is a list: x[0], x[1], x[2] ... The index n is a whole number, so x[2.5] does not exist. This is a discrete-time signal.
A computer stores whole numbers. This 8-bit converter counts in steps of 0.1 mV and has 2⁸ = 256 levels, so 3.39 mV is stored as 34. Discrete in time and in value: a digital signal.
Signals in code
In Python with numpy, a sampled signal is an array. np.arange(40) gives n = 0 to 39; one line computes all 40 samples at once. np.sin takes radians. The first five match the memory.
A heartbeat on an ECG, a day's temperature, a photo (brightness over two directions, x and y): all are signals. Each is a function of one or more variables. Next, systems that change signals.
The working
# step 1/10 · quantity
fork rings at f0 = 440 Hz (the note A4)
air pressure goes up, down, up ...
signal = a quantity that changes
(over time, or over space)
and carries information
here: the pitch 440 Hz says "this is an A"
motion in the figure: slowed down a lot
The amplitude 10 mV is a chosen example of a small microphone voltage; 440 Hz is the standard pitch A4 (ISO 16); 8000 samples a second is the telephone rate of ITU-T G.711. Every number in the figure is computed from this model. The motion is slowed down a great deal: the real fork swings 440 times a second, and the sound crests in the air are drawn much closer together than in real air.