# Help me understand how Pulse-Amplitude Modulation (PAM) works

Reading on the Internet i learned that PAM is basically a sampling technique which converts an analog signal into a discrete signal. It modulates a train of pulses by varying the amplitudes of the individual pulses in a regularly timed sequence based on the analog wave. (Multiplying the analog signal with a train of pulses)

In my mind i have the idea of PAM being similar to AM but instead of an analog carrier we have a train of pulses.

On the other hand in some textbook i read that the way PAM works is by grouping bits from a stream into symbols and each symbol corresponds to a pulse with a certain amplitude.

This seems to me as a completely different process than the first definition. So what is true? and if both are true when is the second way to do PAM used?

$$s(t)=\sum_kA_kp(t-kT)\tag{1}$$
where $A_k$ are the amplitudes representing the analog or digital source signal, $p(t)$ is the pulse, and $T$ is the symbol rate.
The signal $(1)$ is a baseband PAM signal, which can be modulated by a carrier to obtain passband PAM. Using complex symbols $A_k$ on a rectangular grid in the complex plane and two orthogonal carriers gives you quadrature amplitude modulation (QAM). Take a look at this answer for more information on passband PAM.