So, the technical difference between a scrambler and an interleaver:
- The interleaver is just a permutation of input symbols; a resorting.
- The scrambler is an operation designed to modify the transmitted symbol in such a way that they are not present in the output.
Thus, "scrambler" is a way less precise defined term. I usually define it as "operation that is easy to invert if you know the transmit operation, and typically fulfills more of a statistical purpose than a cryptographic one".
The typical purpose of a scrambler is to break up periodicities in the original symbol stream; this can, for example, be done by combining with a pseudorandom sequence. To de-scramble, the receiver would do the inverse combination (in case of XOR, it's autoinverse) with the same sequence. Often, that sequence is longer than a "block" of transmitted signals.
That way, you're basically applying an uncorrelated signal to your data signal; even if you had spikes in the spectrum of your data signal, because it had repetitiveness in it, these will (in expectation) be gone after scrambling, and you get a nice, white spectrum.
A white spectrum is important:
- you will need to adhere to legal restrictions on power, and these usually specify "maximum power within a small bandwidth". So, if you want to use the most of your expensive spectrum, you want to have a nice PSD without peaks.
- from frequency-selective channel point of view, having peaks in the spectrum is a dangerous game: if a deep fade happens to fall on the peak, you lose a lot of signal. You can "distribute" your risk better if you evenly use the channel.
- from a synchronization point of view, for many synchronization algorithms, it's important that
- the spectrum is symmetric (e.g. for the band-edge frequency locked loop (FLL)) or
- that all symbols are equally likely (you'd have a peak at 0 Hz in your spectrum if you have an "average != 0" signal) (important for PLLs, otherwise the assumption that all symbols are equally likely breaks, and that breaks the optimality of "correcting" towards the closest correct phase)
- that there's no runs of constant symbols, even if that happens likely in the input data (e.g. constant-rate digital broadcasting: when there's no bits to transmit, because e.g. everything is silent or the video codec only needs to compress a still image, then you have to pad with 0s, so that you keep your symbol rate) (extremely crucial for symbol timing recovery to have enough symbol transitions)
The interleaver, on the other hand, doesn't change the fact that your data signal might have periodic components: sure, you're moving them to different positions, but they're still there; you just "moved" the spikes in the spectrum in phase, you have little chance of actually getting rid of them.
On the other hands, if you have a burst error on say symbols Nr. 100 to Nr. 200, your XOR-scrambler would still have that burst error in the same range. After a sufficiently long interleaver, the same burst error would be distributed to more or less isolated singular errors, which might be much better for the channel decoder down the processing line.
So, all in all:
- interleaver against burst errors
- scrambler against unwanted regularities in the signal.