A1142 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A11 · Lesson 42 · Detection

Choosing the threshold that makes the fewest mistakes

An optical receiver sees either no light (a 0) or a pulse of 1 V (a 1), plus noise. Where should it set the threshold between them? Halfway seems obvious, and it's right if 0s and 1s are equally common. If 1s are rare, the best threshold moves up. A radar faces the same choice with no way to know how often targets appear, so it fixes how many false alarms it can live with and catches as many targets as that allows. Both are applications of Bayes' rule (lesson 5) to a continuous measurement, and both give error rates you can compute with the Q function.

  • The two curves are the received voltage's density for a sent 0 and a sent 1, each weighted by how often that symbol is sent. Noise has standard deviation σ.
  • Drag the threshold t. The shaded areas are the two kinds of mistake; the readout adds them into the error rate.
  • Make 1s rare. Where do the weighted curves cross now? Put the threshold there and compare the error rate with the halfway threshold.

Predict

A receiver gets 0 V or 1 V plus noise of σ = 0.2 V. Only 10% of the bits are 1s. Where should the threshold go?

Name it

Decisions and their errors

A receiver measures r and decides between hypotheses H0 (a 0 was sent, no target) and H1 (a 1, a target). Its two kinds of mistake:

  • false alarm: deciding H1 when H0 is true, probability PFA;
  • miss: deciding H0 when H1 is true, probability PM; the detection probability is PD=1−PM.

These are the type I and type II errors of lesson 38. With priors P0 and P1, the overall error rate is Pe=P0PFA+P1PM.

The minimum-error rule

To make Pe as small as possible, decide whichever hypothesis has the larger posterior. By Bayes' rule that means comparing P1p(r∣H1) with P0p(r∣H0), the weighted curves in the sim. Equivalently, decide H1 when the likelihood ratio exceeds the prior odds against it:

Λ(r)=p(r∣H1)p(r∣H0)>P0P1

With equal priors this is maximum likelihood: pick the hypothesis that best explains r.

On-off signaling in Gaussian noise

For 0 or A plus Gaussian noise σ, the rule becomes a threshold on r:

t=A2+σ2Aln⁡P0P1

With equal priors, t=A2 and Pe=Q(A2σ). Antipodal signaling, ±A, puts the levels 2A apart and gives Pe=Q(Aσ), the result of lesson 41.

Neyman–Pearson: fixed false alarms

A radar can't know how often targets appear, and false alarms have a cost of their own. So it fixes PFA and maximizes PD. For a target of amplitude A in Gaussian noise, set the threshold at t=zσ where Q(z)=PFA; then

PD=Q(z−Aσ)

Plotting PD against PFA as the threshold moves gives the receiver operating characteristic (ROC), the standard picture of a detector's quality.

Worked example

A receiver gets 0 or 1 V with noise σ = 0.2 V, and 10% of the bits are 1s. Find the best threshold and compare its error rate with a threshold at 0.5 V.

Show the solution
  1. Best threshold. t=0.5+0.04ln⁡9=0.588V
  2. Error rate there. Pe=0.9Q(0.588/0.2)+0.1Q(0.412/0.2)=0.9Q(2.94)+0.1Q(2.06)=0.00148+0.00197=0.00345
  3. At 0.5 V. Both tails are Q(2.5)=0.00621, so Pe=0.00621.
  4. Compare. The better threshold cuts errors by 44%.

Answer the best threshold is 0.588 V, with an error rate of 0.00345 against 0.00621 at 0.5 V.

Worked example

A radar wants PFA=10−6 per look and PD=0.9. What signal-to-noise amplitude ratio does it need?

Show the solution
  1. Threshold from the false-alarm rate. Q(z)=10−6givesz=4.75
  2. Detection. For PD=0.9, Q(z−A/σ)=0.9 means z−A/σ=−1.28
  3. Solve for the ratio. Aσ=4.75+1.28=6.03 or 15.6 dB.
  4. The cost. Low false alarm rates are expensive: the threshold has to sit almost five noise widths up.

Answer it needs A/σ=6.03, or 15.6 dB.

Worked example

Bits of 0 and 1 V are equally likely, with noise σ = 0.2 V. What threshold minimizes errors, and what error rate results?

Show the solution
  1. Threshold. With equal priors and equal noise, the best threshold is halfway, 0.5 V.
  2. Distance in standard deviations. Each symbol is 0.5 V from it: 0.50.2=2.5
  3. Error rate. Pe=Q(2.5)=0.0062
  4. A better signal. On–off signaling wastes power compared with ±0.5 V, which gives the same distance between levels with half the average power.

Answer the threshold is 0.5 V, and the error rate is 0.0062.

Check

On-off signaling uses 0 and 1 V, with Gaussian noise σ = 0.2 V and equal priors. What is the error rate with the best threshold?

Check

On-off signaling with levels 0 and 1 V, noise σ = 0.2 V, and a fraction 0.2 of 1s. Where is the minimum-error threshold?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

Check

1s make up a fraction 0.25 of the bits. A minimum-error receiver decides 1 when the likelihood ratio exceeds what?

Check

Antipodal signaling uses ±0.5 V with noise σ = 0.2 V and equal priors. What is the error rate?

Check

A detector sets its threshold at 3.09σ. A target arrives with amplitude 4σ. What is the detection probability?

Check

A detector's threshold is 3σ above the noise's mean. What is its false alarm rate?

Check

On–off bits of 0 and 1 V, equally likely, with noise 0.2 V.

(a)

Where is the best threshold?

Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.

(b)

What is the error rate?

Check

Levels 0 and A with noise s, where the 1 has prior probability p.

Step 1

Where is the minimum-error threshold?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Check

Levels 0 and 1 V, noise σ = 0.2 V, and a 1 sent with probability 0.1. Search thresholds from 0.3 to 0.9 V in steps of 0.0001 for the lowest error rate 0.9Q(T/σ)+0.1Q((1−T)/σ), and set T_best; set T_formula to 12+σ2Aln⁡1−pp.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why should the threshold move toward the less common symbol's level?

Practice

Keep practicing

10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.