Algorithmadvanced
Luise and Reggiannini frequency estimator
Also called L and R frequency estimator.
Estimates the carrier frequency from the angle of a sum of L sample autocorrelations. With L near N/2 it stays close to the CRB down to low SNR; its range |nu| < 1/(L+1) shrinks as L grows.
- Time
- O(N L) worst
- Space
- O(1) extra
- Where
- L = the number of autocorrelation lags; N = the number of samples
- Model
- Real RAM
- Properties
- data aideddeterministicfeedforward
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Marco Luise, Ruggero Reggiannini, 1995
The Luise and Reggiannini (L and R) estimator finds a carrier frequency offset from samples whose data are known or have been removed. It computes the sample autocorrelations at the lags , adds them, and divides the angle of the sum by . The sum of the noise-free terms has the exact angle for , so the parameter trades the range against the noise: with near , the variance stays close to the Cramer-Rao bound down to low SNR, which in synchronization with known data is the modified Cramer-Rao bound. It belongs to the estimators for frequency offset estimation. The Kay estimator uses only lag 1, so it has the full range but a higher threshold, and the Rife and Boorstyn estimator is the ML periodogram peak with the full range and the lowest threshold, at the cost of an FFT and a search. In OFDM, the Moose and Schmidl and Cox estimators use the same idea at one long lag between repeated symbols.
In plain words
A tone turns by a fixed angle per sample. Comparing each sample with the sample one step earlier shows that angle, but noisily. Comparing with the sample two steps earlier shows twice the angle, three steps earlier three times, and so on. The receiver averages all these comparisons up to some number of steps and reads one angle from the total. Using many steps averages more noise away, but if the tone turns too fast, the comparisons over many steps go more than half a turn round and the answer is wrong. So the number of steps sets both the accuracy and the largest offset that can be measured.
The problem
The input is , , where is the frequency offset in cycles per symbol, and are unknown, and is white, . In a burst modem, for the received samples and the known preamble symbols of unit modulus. Choose and output .
The algorithm
L-AND-R(z[0..N-1], L)- 1
N <- length of z - 2
S <- 0 - 3
for m <- 1 to L do - 4
S <- S + (1 / (N - m)) * sum over k = m..N-1 of z[k] * conj(z[k - m]) ▷ R(m) - 5
return arg(S) / (pi * (L + 1))
Line L4 is the unbiased sample autocorrelation at lag . Line L5 divides by , not by , because the angle of the sum of the lags to is the mean lag times . The result is in cycles per symbol; multiply by for radians per symbol, or divide by the symbol period for hertz.
Example
, , , dB (noise seed 10), , so the range is . Line L4 gives:
| noise-free | ||
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 |
, with . Line L5 gives , an error of . The bound for at 10 dB is a standard deviation of cycles.
With , 300 random offsets per point, uniform in (seed 3), the mean square error over the CRB was (measurements):
| range | dB | 0 dB | 3 dB | 5 dB | 10 dB | |
|---|---|---|---|---|---|---|
| 4 | ||||||
| 8 | ||||||
| 16 | ||||||
| 24 |
is within about 20 percent of the bound down to 0 dB and within 36 percent at dB, and a larger does not help. A small widens the range but costs accuracy at every SNR.
Correctness
Claim. Each is an unbiased estimate of . Without noise, exactly for (theorem). Outside the range the estimate aliases: for it returns (theorem). That the variance is close to the CRB for is a closed form under assumptions in the original paper and a measurement here.
Key steps. . For the real factor is positive and , so the angle of the sum is exactly . Beyond the range, the angle wraps or the real factor turns negative, which the proof works out.
Proof: Without noise the L and R estimate equals nu for |nu| < 1/(L+1), each R(m) is unbiased for a tone in white noise, and outside the range the estimate aliases in a known wayfull
The input is , , with , independent with mean zero and variance , and an integer . Line L4 adds the sample autocorrelations for , and line L5 returns with and in .
Lemma 1 (each autocorrelation is unbiased). for , and without noise exactly.
Proof. Write . Then . The first term is for every . The other terms have mean zero, because has mean zero and, for , and are independent. Averaging over the values of gives the claim.
Lemma 2 (the sum of the noise-free terms). For , .
Proof. The geometric sum is , and .
Theorem 1 (exact without noise inside the range). If for all and , then .
Proof. By Lemma 1, . If , and . Otherwise, by Lemma 2, with . Since , the numbers and have the sign of , so . Hence , and since , exactly. Line L5 gives .
Theorem 2 (aliasing outside the range). Without noise, if , then . If (possible when ), then .
Proof. In the first case, still, since , and , so . In the second case, and , so and . As , the value lies in , so .
So the range of the estimator is : a larger averages more lags but narrows the range. Without the noise, this is all exact.
With noise. By Lemma 1, is an unbiased estimate of , and inside the range ( is the Dirichlet kernel, which decreases from at to at the edge). The angle of an unbiased estimate is not an unbiased estimate of the angle, so the statement that the estimate has a small bias and a variance close to the Cramer-Rao bound for is not a theorem here: it is a closed form under assumptions in the paper of Luise and Reggiannini (a high-SNR linearization) and a measurement in the tests. The noise terms are products of two noise samples, which is why the estimator degrades at low SNR, and why the degradation is mild: the sum over and averages about such products.
Complexity. Line L4 computes sums of at most terms, time; for this is , or if all autocorrelations are computed with a zero-padded FFT. The extra space is for the direct form.
Complexity
The direct form costs time, which is for , and extra space. All autocorrelations can be computed with a zero-padded FFT in . Only one angle is computed, at the end; the Kay estimator needs angles.
Properties
- Range set by . cycles per symbol. For and this is , so the estimator is a fine estimator after a coarse one, or for small offsets.
- Close to the bound down to low SNR. For the measured error is within about 20 percent of the CRB down to 0 dB. The angle is taken once, after averaging, so there are no wraps of single differences, which is what limits the Kay estimator.
- Data-aided. The data must be removed. For M-PSK without known data, apply it to ; the range is then divided by , and the noise grows.
- Simple. One sum of products and one angle; no search, no FFT required, no unwrapping.
- Biased near the range edge. As approaches , the noise pushes the angle over more often, and the estimate aliases.
Variants and improvements
- Fitz estimator. Takes the angle of each separately, unwraps them across and fits a line. It has a similar range and accuracy.
- Mengali and Morelli estimator. Uses the phase differences with optimal weights, which gives a range of independent of and an accuracy close to the bound.
- Closed-loop form. Luise and Reggiannini also used of the estimate as a frequency error detector in a recursive loop for continuous transmission.
- Coarse plus fine. Use a small , or the Kay estimator, for a coarse estimate, derotate, then use for the fine estimate.
- OFDM forms. With a repeated training symbol, the same angle-of-correlation idea at one long lag gives the Moose and Schmidl and Cox estimators.
When to use it
Use it in burst modems with a known preamble, when the residual offset is small compared with the symbol rate and the SNR is low, for example a few dB, so that the Kay estimator is below its threshold. Choose as large as the largest expected offset allows, up to about . For large offsets, use a coarse stage first, or the Rife and Boorstyn estimator.
Pitfalls
- Offset larger than the range. An offset above gives a wrong estimate with no warning. In the tests, with returned .
- Leaving the data in. Unknown symbols randomize the products . Divide out the preamble, or use a power for PSK.
- Dividing by . The angle of the sum is ; dividing it by instead of gives a wrong scale.
- Using biased autocorrelations. Dividing every by instead of gives the long lags less weight. The angle of the noise-free sum is then no longer exactly , and the estimate has a bias even without noise.
- Taking larger than . It narrows the range and, in the measurement, did not improve the variance.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/luise-reggiannini-estimator/. The authors are listed in prov/6HGD52.jsonl.
"""The Luise and Reggiannini (L and R) frequency estimator.
For z[k] = A e^(j(2 pi nu k + phi)) + w[k], k = 0, ..., N-1 (the received
samples with the known data removed), compute the sample autocorrelations
R(m) = 1/(N - m) sum_{k=m}^{N-1} z[k] conj(z[k-m]), m = 1, ..., L,
and estimate the normalized frequency nu (cycles per sample) as
nu_hat = arg(sum_{m=1}^{L} R(m)) / (pi (L + 1)).
Without noise this is exact for |nu| < 1/(L + 1), which is the range of the
estimator. L is the design parameter: L = N/2 gives a variance close to the
Cramer-Rao bound, and a smaller L gives a wider range.
"""
import cmath
import math
from typing import Sequence
def autocorrelation(z: Sequence[complex], m: int) -> complex:
"""R(m) = 1/(N - m) sum_{k=m}^{N-1} z[k] conj(z[k-m])."""
n = len(z)
return sum(z[k] * z[k - m].conjugate() for k in range(m, n)) / (n - m)
def lr_estimate(z: Sequence[complex], big_l: int) -> float:
"""The L and R estimate of nu, in cycles per sample, in (-1/(L+1), 1/(L+1)]."""
n = len(z) # @line L1
if not 1 <= big_l <= n - 1:
raise ValueError("need 1 <= L <= N - 1")
s = 0j # @line L2
for m in range(1, big_l + 1): # @line L3
s += autocorrelation(z, m) # @line L4
return cmath.phase(s) / (math.pi * (big_l + 1)) # @line L5
def crb_nu(n: int, snr: float) -> float:
"""The Cramer-Rao bound on the variance of nu_hat: 6 / ((2 pi)^2 SNR N (N^2 - 1))."""
return 6.0 / ((2.0 * math.pi) ** 2 * snr * n * (n * n - 1))
test_luise_reggiannini_estimator.py 70 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/luise-reggiannini-estimator/. The authors are listed in prov/6HGD52.jsonl.
import cmath
import math
import random
from luise_reggiannini_estimator import autocorrelation, crb_nu, lr_estimate
def tone(rng, n, nu, snr=None, phi=0.0):
sd = math.sqrt(0.5 / snr) if snr else 0.0
return [cmath.exp(1j * (2 * math.pi * nu * k + phi)) + (complex(rng.gauss(0, sd), rng.gauss(0, sd)) if sd else 0j) for k in range(n)]
def test_closed_form_of_the_sum() -> None:
# sum_{m=1}^{L} e^(j 2 pi nu m) = e^(j pi nu (L+1)) sin(pi nu L) / sin(pi nu).
for big_l in (1, 4, 16):
for nu in (0.013, -0.04, 0.05):
s = sum(cmath.exp(2j * math.pi * nu * m) for m in range(1, big_l + 1))
c = cmath.exp(1j * math.pi * nu * (big_l + 1)) * math.sin(math.pi * nu * big_l) / math.sin(math.pi * nu)
assert abs(s - c) < 1e-12
def test_exact_without_noise_inside_the_range() -> None:
rng = random.Random(1)
for _ in range(100):
n = rng.randrange(4, 40)
big_l = rng.randrange(1, n)
nu = rng.uniform(-1, 1) * 0.999 / (big_l + 1)
z = tone(rng, n, nu, phi=rng.uniform(-3, 3))
assert abs(lr_estimate(z, big_l) - nu) < 1e-12
def test_aliasing_outside_the_range() -> None:
# For 1/(L+1) < nu < 1/L the angle wraps: the estimate is nu - 2/(L+1).
big_l = 7
nu = 0.135
z = tone(random.Random(2), 32, nu)
assert abs(lr_estimate(z, big_l) - (nu - 2 / (big_l + 1))) < 1e-12
# For 1/L < nu the Dirichlet factor sin(pi nu L)/sin(pi nu) is negative as well.
nu = 1.2 / (big_l + 1)
z = tone(random.Random(2), 32, nu)
assert abs(lr_estimate(z, big_l) - (nu - 1 / (big_l + 1))) < 1e-12
def test_autocorrelation_is_unbiased_for_a_tone() -> None:
z = tone(random.Random(3), 20, 0.03, phi=1.0)
for m in (1, 5, 19):
assert abs(autocorrelation(z, m) - cmath.exp(2j * math.pi * 0.03 * m)) < 1e-12
def test_mse_against_the_crb() -> None:
# N = 32, 300 trials per point, nu uniform in [-0.02, 0.02]. L = N/2 is close
# to the bound down to about 0 dB; L = 8 is clearly worse at 0 dB.
n, trials = 32, 300
ratio = {}
for big_l in (8, 16):
for snr_db in (0, 10):
snr = 10 ** (snr_db / 10)
rng = random.Random(3)
se = 0.0
for _ in range(trials):
nu = rng.uniform(-0.02, 0.02)
e = lr_estimate(tone(rng, n, nu, snr, rng.uniform(-3, 3)), big_l) - nu
se += e * e
ratio[big_l, snr_db] = se / trials / crb_nu(n, snr)
assert 0.8 < ratio[16, 10] < 1.3
assert 0.9 < ratio[16, 0] < 1.8
assert ratio[8, 0] > 1.2 * ratio[16, 0]
History
Marco Luise and Ruggero Reggiannini, at the University of Pisa, published the estimator in the IEEE Transactions on Communications in 1995. They designed it for all-digital burst modems and tested it on a TDMA satellite link and on a mobile radio link with GSM-like signals. They also showed how to use it as a frequency error detector inside a loop. It followed the fast single-tone estimators of Kay (1989) and Fitz, and was followed by the estimator of Mengali and Morelli (1997), which removed the dependence of the range on . Mengali and D'Andrea's book of 1997 presents it among the data-aided frequency estimators.
References
- M. Luise and R. Reggiannini, Carrier frequency recovery in all-digital modems for burst-mode transmissions, IEEE Transactions on Communications 43(2/3/4), 1995, pages 1169 to 1178, the open-loop data-aided estimator from the angle of the sum of autocorrelations, its range and variance, and its use as a frequency error detector in a closed loop
- Umberto Mengali and Aldo N. D'Andrea, Synchronization Techniques for Digital Receivers, Plenum Press, 1997, Chapter 3 (carrier frequency recovery with linear modulations, data-aided feedforward estimators based on autocorrelations)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 6HGD52 Edit this page History Report an error Markdown