Design a direct-sequence spread spectrum (DSSS) communication link. Adjust the chip rate and data rate to see the processing gain, occupied bandwidth and jamming margin update in real time, and find the conditions under which the link survives a jammer.
Parameters
Chip rate R_chip
Mcps
Chip rate of the spreading code; sets the occupied bandwidth
Data rate R_data
kbps
Information bit rate before spreading
Jammer power (relative to signal)
dB
Jammer strength relative to the wanted signal (J/S)
Required Eb/N0 for demodulation
dB
Minimum Eb/N0 to meet the target BER
System loss L_sys
dB
Implementation loss, non-ideal code, synchronisation error, etc.
A narrowband data signal is spread by the chip code into a wide, low spectrum (below the noise floor), then de-spread by the same code back to a narrow line at the receiver. Meanwhile the jammer is spread out and weakened.
Processing gain PG is the chip rate R_chip divided by the data rate R_data. It is a dimensionless number equal to the chips per data bit (the spreading factor); PG_dB expresses it in decibels.
Jamming margin M_J [dB] — how many dB stronger than the wanted signal a jammer can be. What remains after subtracting the required Eb/N0 and the system loss L_sys is the available margin.
In essence the processing gain is simply the ratio of the spread bandwidth to the data bandwidth: the wider the spreading, the greater the resistance to interference.
What is Spread Spectrum?
Student
"Spread spectrum" deliberately scatters a signal across a wide band, right? Spreading a perfectly good radio signal out sounds wasteful — why would anyone do that?
Professor
Good question. It does look wasteful at first, but it is a remarkably powerful trick. The data itself only needs a narrow band, but before transmitting we multiply it by a much faster pseudo-random "chip code". That smears the signal energy thinly over a wide bandwidth, so the transmitted wave can even sit below the noise floor — it becomes so faint you can barely tell it is there.
Student
Wait — if the signal is below the noise, can the receiver even pick it up? It sounds like it would just be lost in the noise.
Professor
That is the clever part. At the receiver you multiply by the SAME chip code again, and the wanted signal collapses back into a narrow band as one strong, tall line — that step is called de-spreading. A jammer's signal, on the other hand, was never multiplied by that code on transmit, so de-spreading instead spreads it out and weakens it. The same operation makes the friendly signal strong and the hostile one weak — that asymmetry is the whole point.
Student
I see! So that "how much stronger" ratio is the processing gain. When I raise the jammer power on the left, the verdict turns red.
Professor
Exactly. Processing gain PG is the wide spread bandwidth divided by the narrow data bandwidth — that is R_chip / R_data. At the defaults, 10 Mcps ÷ 100 kbps gives 100×, which is 20 dB. Subtract the required Eb/N0 and the system loss from that 20 dB and what remains is the jamming margin — how many dB stronger than the wanted signal a jammer can be. At the defaults there is only 11 dB of margin but the jammer is 20 dB, so the link loses.
Student
So to beat the jammer I need to raise the processing gain. Do I just crank up the chip rate?
Professor
There are two levers: raise the chip rate, or lower the data rate. Raising the chip rate also widens the occupied bandwidth, so if your allotted spectrum is limited you hit a ceiling. Lowering the data rate puts more chips on each bit and buys processing gain without using more bandwidth — but throughput drops, of course. Move both sliders on the charts below and you will see the margin jump up sharply when you lower the data rate.
Student
Where is this mechanism actually used in the real world?
Professor
The most familiar example is GPS — the satellite signal is below the noise at the ground, yet the receiver recovers it by de-spreading with the correct code. There is also CDMA cellular telephony, the original DSSS mode of WiFi, and military anti-jam communications. And if you assign each user a different orthogonal code, the same band can be shared by many users — multiple access. One idea delivers jamming resistance, low probability of intercept and multiple access all at once: a very powerful concept.
Frequently Asked Questions
Processing gain PG is the ratio of the wide spread bandwidth to the narrow data bandwidth: PG = R_chip / R_data. It equals the spreading factor — the number of code chips multiplied onto each data bit — and is a dimensionless number. In decibels it is PG_dB = 10·log10(PG). At the receiver, de-spreading collapses the wanted signal back into a narrow, strong line, while an interferer whose code does not match is spread out and weakened. The ratio between the two is exactly PG, and it directly buys jamming resistance (the jamming margin).
The jamming margin M_J is the processing gain minus the required Eb/N0 and the system loss: M_J = PG_dB − (Eb/N0)_req − L_sys [dB]. It tells you how many dB stronger than the wanted signal a jammer can be while the link still works. For PG_dB = 20 dB, required Eb/N0 = 7 dB and system loss = 2 dB, M_J = 11 dB. If the jammer stays within 11 dB of the wanted signal the link survives; beyond that it drops.
Since PG = R_chip / R_data, you raise PG by increasing the chip rate or by lowering the data rate. Raising the chip rate also widens the occupied bandwidth (about 2× the chip rate), so the available spectrum sets an upper limit. Lowering the data rate puts more chips on each bit and buys processing gain without using more bandwidth, but it of course reduces throughput. In practice you maximise PG within both the allotted-bandwidth limit and the required data-rate target.
The transmitter multiplies the narrowband data signal by a much faster pseudo-random chip code, smearing its energy thinly over a wide bandwidth. The signal can sit below the noise floor, so a third party who does not know the code can neither intercept nor decode it (low probability of intercept). The receiver multiplies again by the same code to de-spread, recovering only the wanted signal as a narrow, strong line. A jammer whose code does not match is instead spread out and weakened by the same operation. This asymmetry is why spread spectrum resists jamming, interception and multipath.
Real-World Applications
GPS and satellite positioning: The signal arriving from a GPS satellite is weaker than the antenna noise at ground level — a spectrum analyser cannot tell it apart from noise. The receiver still recovers it by de-spreading with the C/A code assigned to each satellite, pulling the signal out of the noise to fix a position. The larger the processing gain, the more reliably positioning holds up with weak satellites or in urban multipath.
CDMA cellular telephony: In 3G mobile (W-CDMA, cdma2000), all users occupy the same frequency band at the same time and are distinguished by mutually orthogonal spreading codes. The processing gain turns every other user's signal into "wide, thin interference" that averages out, realising code-division multiple access (CDMA) so that scarce spectrum is shared among many users.
Military and anti-jam communications: Against hostile jamming, spread spectrum holds out by the amount of its jamming margin. For critical links, direct sequence is combined with frequency hopping so that a jammer cannot easily follow. The jamming-margin calculation in this tool serves as a first-order estimate of how strong a jammer an anti-jam link can survive.
WiFi, Bluetooth and IoT: Early IEEE 802.11 (up to 11 Mbps) used DSSS, and Bluetooth and many IoT radios use frequency-hopping spread spectrum. In the licence-free ISM bands, many devices share crowded spectrum, so interference resistance from spreading — and a low transmit spectral density that causes little disturbance to other devices — both matter.
Common Misconceptions and Pitfalls
A common misconception is that processing gain improves the signal-to-noise ratio itself. Processing gain improves the ratio of wanted to interfering power inside the receiver; it does not magically raise the absolute signal-to-noise ratio of the wave travelling through the air. Against white (thermal) noise, spreading does not change the energy per bit Eb, so Eb/N0 is essentially not improved. Processing gain works against narrowband jammers and interferers, or against other users in multiple access. Do not confuse this — there is no gain against broadband white noise itself.
Next, assuming the occupied bandwidth equals the chip rate. The main-lobe (null-to-null) bandwidth of a direct-sequence signal is roughly twice the chip rate (this tool approximates it as 2× the chip rate). Depending on the implementation and how lobes or filters are defined, some count it as 1×, and there are several schools of thought (for example, "processing gain is a bandwidth ratio, so use 2×"). When comparing numbers across references or tools, always align the definitions of bandwidth and processing gain (null-to-null, 3 dB bandwidth, or R_chip/R_data).
Finally, do not let a positive jamming margin lull you into thinking the link is absolutely safe. The M_J in this tool is a first-order calculation assuming a steady, average jammer. Real jamming includes partial-band jamming aimed at a spectrum near the wanted code, pulse jamming, repeater jamming and other sophisticated techniques that average power alone cannot capture. And if synchronisation drifts, the de-spreading gain itself drops sharply. The margin is only a starting point for design; the real resistance must be verified separately against worst-case jamming scenarios, synchronisation margin and the interplay with error-correction coding.
How to Use
Set the chip rate (1–100 Mcps) using the chipRateRange slider to define the spread spectrum bandwidth.
Specify the data rate (1–10 Mbps) via dataRateRange; the simulator calculates spreading factor as chip rate divided by data rate.
Enter jammer power level (jammerRange in dBm) and required Eb/N0 (ebn0ReqRange in dB) to compute jamming margin as PG minus jammer interference ratio.
Review Processing gain in dB (10×log₁₀(spreading factor)), occupied bandwidth, and system verdict for link viability under jamming conditions.
Worked Example
Configure a DSSS military communication system: chip rate = 32 Mcps, data rate = 2 Mbps, spreading factor = 32÷2 = 16 chips/bit, processing gain = 10×log₁₀(16) ≈ 12.04 dB. Occupied bandwidth = 32 MHz. Against a jammer at −70 dBm with required Eb/N0 of 7 dB, jamming margin = 12.04 − 7 = 5.04 dB, sufficient for reliable reception in contested RF environment.
Practical Notes
Higher spreading factors (e.g., 128 chips/bit at 10 Mcps data, 1280 Mcps chip rate) increase processing gain but widen occupied bandwidth; balance throughput against jamming resistance.
Jamming margin below 3 dB indicates marginal performance; increase chip rate or lower data rate to boost processing gain and link robustness.
In frequency-hopping systems, reduce occupied bandwidth by using lower chip rates, but verify compliance with FCC Part 15 (2.4 GHz ISM ≥ 1 MHz hopping bandwidth) or MIL-STD-1377 for military deployment.