This paper deals with waveform encoding methods in which binary data are mapped into constrained binary sequences for shaping the frequency spectrum of corresponding waveforms. Short and long pulse widths in the waveform are limited by constraints on the minimum and maximum run-lengths of zeros in the coded sequences. These constraints reduce the intersymbol interference in magnetic recording and provide an adequate rate of transition for accurate clocking. Signal power at low frequencies is limited by means of a constraint on a parameter that corresponds to the maximum imbalance in the number of positive and negative pulses of the waveform. This constraint on the maximum accumulated dc charge also eliminates the zero-frequency component. Zero modulation is one such code that is especially suitable for magnetic recording channels. The encoding and decoding algorithm is presented. A one-to-one correspondence between binary data and constrained sequences is established by creating data states that are isomorphic to the charge states having the same growth rate. Sequences with other values of run-length and charge constraint are examined as candidates for other codes with zero dc component.