Transceiver52M: Refactor RACH and normal burst detection

Both RACH and normal bursts are detected with the same approach of
midamble correlation combined with peak-to-average ratio. The
difference is the midamble placements and lengths. Thus, there is
no reason to have independent implementations.

This patch creates a common call burstDetect(), while leaving the
correlation window indexing in the original calls.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Increase normal and RACH correlation thresholds

Because we can. New threshold values obtained by from bench testing
with generated noise and modulated PN sequences. Detection still
achievable near noise floor.

Signal source: Rohde & Schwarz SMIQ

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Check that sample rates are sane before using

If there is an error in the sample rate determination, noted
by a negative return sample rate value, error directly and
don't try to set the device rate.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Setup dual Laurent pulse shaping filter

Provides substantially improved transmit phase error
performance when enabled. Requires use of 4 samples
per symbol, and is enabled by default when set.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Set 4 samples-per-symbol as default

Aside from embedded systems (e.g. ARM), CPU load for OpenBTS
on the majority of user systems is minimal. Set 4 SPS using
dual pulse Laurent GMSK approximation as the new default.
This allows operation with phase error below 1 degree RMS on
capable RF devices.

Disable support at 2 sps since the phase error improvements
are marginal compared to the dual pulse 4 sps configuration
without the low compuatational benefits of 1 sps.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Add B200 support

Set master clock rate to 52 MHz for B200. Also, we want to avoid
floating point comparison errors on clock rate settings, but we
expect to be able really set the rates we specify. Set the
offset limit to 1 Hz. If we can't set our rates with that level
of precision, then something is wrong.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Widen resampling filter bandwidth

This patch only applies to resampling use at 4 samples-per-symbol.
By extention that means only USRP2 / N2xx devices are affected.
By widening the resampling filter we achieve slightly better total
phase distortion. At 4 samples-per-symbol this gives us below
0.7 degrees of RMS phase error on USRP2 against Agilent E4406A
signal analyzer.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Reduce RACH and TSC correlation windows

Start the correlation search window at 4 symbols before
the expected correlation peak. End the search at 10
symbols and 4 + maximum expected delay for RACH and TSC
bursts respectively.

This change lowers receive side cpu utilization while
maintaining reasonable timing jitter and accuracy tolerance.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Disable equalization

Unsupported at 4 sps, and performance benefits remain
to be proven at 1 sps. Disable until further testing.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Downsample receive path to 1 sample-per-symbol

We don't need to run the full 4 sps receive signal through the
GSM receiver. In fact, we're better off bandlimiting the signal
(because of noise) and downsampling (for efficiency). Run both
through the quarter rate polyphase resampler.

In the absence of interference (external or internal generated)
this allows decoding below -100 dBm on most devices with a
signal generator reference signal.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
Transceiver52M: Update device offset timings

Update empirically determined device Tx/Rx offset settings
for new modulator configuration. These offsets are the
combinations of filter group delays and other device lag
times that occur before and after the sample timing point
in the FPGA.

Signed-off-by: Thomas Tsou <tom@tsou.cc>