This is an old revision of the document!
Signal detection
Let $r[n]$ be a noisy signal that is either:
$$ H_0: R[n] = W[n] $$
$$ H_1: R[n] = s[n] + W[n] $$
where $s[n]$ is the signal that we are trying to detect, and $W[n]$ is an i.i.d. zero-mean Gaussian process with variance $\sigma^2$.
The maximum a posteriori rule can be written as:
$$ \frac{f(r[0], r[1], \dots, r[L-1] | H_1)}{f(r[0], r[1], \dots, r[L-1] | H_0)} \overbrace{\gt}^{'H_1'} \underbrace{\lt}_{'H_0'} \frac{p_0}{p_1}$$
Given that $W[n]$ is Gaussian, this can be rewritten as:
$$ \frac{\prod_{n = 0}^{L - 1} \left( \frac{1}{\sigma \sqrt{2 \pi}}e^{-\frac{(r[n] - s[n])^2}{2 \sigma^2}} \right)}{\prod_{n = 0}^{L - 1} \left( \frac{1}{\sigma \sqrt{2 \pi}}e^{-\frac{(r[n])^2}{2 \sigma^2}} \right)} \overbrace{\gt}^{'H_1'} \underbrace{\lt}_{'H_0'} \frac{p_0}{p_1} $$
After some simplifications, we get:
$$ g = \sum_{n = 0}^{L - 1} r[n] s[n] \overbrace{\gt}^{'H_1'} \underbrace{\lt}_{'H_0'} \sigma^2 \ln \eta + \frac{\varepsilon}{2} = \gamma $$
where $\eta = \frac{p_0}{p_1}$ and $\varepsilon = \sum_{n = 0}^{L - 1} s^2[n]$ (Energy)
Let $G$ be the random variable of which $g$ is a realized value. Similarly, $R[n]$ is the random process of which $r[n]$ is a realized instance. Then,
$$ G = \sum_{n = 0}^{L - 1} R[n]s[n] $$
The distributions of $G$ are:
$$ H_0: G \sim \mathcal{N}(0, \sigma^2 \varepsilon) $$ $$ H_1: G \sim \mathcal{N}(\varepsilon, \sigma^2 \varepsilon) $$
Note that the variance is the same in both cases.