In signal processing, zero padding is the addition of zero-valued samples to the end of a signal to increase its length. Zero padding can be used in the [[windowing]] process so that all samples of the signal are used in frames and the number of frames is independent from the length of the window. If we want to apply the windowing process to a signal of length $L$, using a [[window length]] of $N$ and a [[hop length]] of M, if we pad the signal with $P$ zeros: $ P = \left\lfloor \frac{L}{M} \right\rfloor M + \left(\left\lceil \frac{L}{M} \right\rceil - \left\lfloor \frac{L}{M} \right\rfloor\right) N -L $ all the samples of the signal will be used. This way, the number of resulting frames is only dependent on the hop length: $ N_{frames} = \left\lceil \frac{L}{M} \right\rceil $