aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/sigProcLib.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-04-26EDGE: Fix demodulation slicer inputTom Tsou1-1/+1
EDGE 8-PSK soft slicer was receiving input from the output of the downsampler. Equalization and derotation were missing causing the soft symbol output to be invalid. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-04-26uhd: Correct timing alignment in 8-PSK and GMSK downlink burstsTom Tsou1-5/+14
Delay the EDGE downlink bursts by one symbol in order to match GMSK pulse shaping group delay. The difference in group delay arises from the dual pulse filter combination of the GMSK Laurent represenation whereas 8-PSK uses a single pulse linear filter. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-04-20transceiver: Add an option to generate random Access Bursts.Alexander Chemeris1-0/+33
2016-04-20transceiver: Properly handle MAXDLY.Alexander Chemeris1-4/+5
Previously MAXDLY value was applied to Normal Bursts, which was nice when working with sloppy test equipment like CMD57, but useless for real world usage. At the same time documentation and de facto usage of MAXDLY in OsmoBTS and OpenBTS assumed that it actually applies to Access Bursts (RACH). So this patch changes osmo-rx behavior to apply MAXDLY to RACH bursts and introduces a new command MAXDLYNB for the old behavior.
2016-03-08EDGE: Combine shared GMSK and 8-PSK demodulator sectionsTom Tsou1-22/+35
Timing recovery and single tap channel compensation are identical in both GMSK and EDGE receivers. This is the section ahead of and including the optional 4-1 downsampler. GMSK and EDGE specific sections operate at 1 SPS. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-08sigproc: Add various GSM burst generatorsTom Tsou1-0/+62
Setup generators for empty, random, and dummy bursts. This moves error prone burst length handling out of the Transceiver and into the signal processing core. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-08sigproc: Always use 625 sample length bursts with 4 SPSTom Tsou1-12/+12
At 4 samples per symbol, we don't need to maintain the 156/157 sample slot structure to account for the GSM 156.25 sample burst length. Set the 4 SPS Laurent modulator to ignore the guard interval setting and always output 625 sample sized bursts. The EDGE 8-PSK modulator already has this behavior. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06EDGE: Add 8-PSK modulator and demodulatorTom Tsou1-25/+465
Setup correlator and detection process similar to the GMSK receiver chain. Require 4 SPS sampling on both Rx and Tx paths as 1 SPS sampling adds too much distoration for 8-PSK recovery. Core receiver operations still run at 1 SPS with the exception of fractional delay filtering, which runs at the higher rate. Perform linear equalization to handle the Gaussian pulse induced ISI. The fixed impulse response used for equalizer tap calculation consists of combined EDGE pulse shape filter and effects of the downsampling filter. Note that the non-adaptive equalizer corrects for modulation induced band limiting and does not account for or compensate for fading channel effects. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06sigproc: Remove normal burst DFE equalizerTom Tsou1-171/+1
DFE equalizer is unused and has been experiencing code rot for multiple years. The effect is a significant amount of baggage being carried in the Transceiver and interfaces. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-03-06sigproc: Remove dynamic SPS configurationTom Tsou1-48/+50
Samples per symbol used by the transceiver is not configurable through the socket interface once running, so stop pretending like it could be. Initialize all tables and midambles at start. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30sigProcLib: Abstract out common part of Normal/RACH burst detection.Alexander Chemeris1-70/+53
As a side change - get rid of passing toa and amp arguments as pointers and use references instead. The commit doesn't change behaviour, but makes the code cleaner. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30sigProcLib: Check for bogus TOA before using it.Alexander Chemeris1-2/+2
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-07-30Transceiver: Fix clipping detection.Alexander Chemeris1-15/+31
There are two primary changes in this commit: 1) Return values of detect functions changed form bool to int to actually pass the return value from the inner function and notify higher levels about clipping. Previously the information was lost due to conversion to bool. 2) Clipping level is not the final verdict now. We still try to demod a burst and mark it as clipped only if the level is above the clipping level AND we can't demod it. The reasoning for this is that in real life we want to do as much as possible to demod the burst, because we want to get as much from our dynamic range as possible. So a little bit of clipping is fine and is expected. We just don't want too much of it to break our demod. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-06-01sigProcLib: Fix burst start phase.Alexander Chemeris1-1/+1
R&S CMD57 complains about the start phase of bursts, particularly it shows -15 to -30 deg of error for the bit 0.5 position (start tail bit). This patch makes it happy. ETSI TS 145 004 section 2.2 describes this: "Before the first bit of the bursts as defined in 3GPP TS 45.002 enters the modulator, the modulator has an internal state as if a modulating bit stream consisting of consecutive ones (di = 1) had entered the differential encoder." Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2015-05-18sigproc: Add clipping detection on RACH and TSC inputTom Tsou1-4/+25
Alert user of overdriven burst input indicated by a positive threshold detector result. This indication serves as notification that the receive RF gain level is too high for the configured transceiver setup. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2013-11-15Transceiver52M: Enable all warnings and resolveThomas Tsou1-5/+6
Mainly basic signed vs unsigned comparisons and intializer ordering. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Remove unused codeThomas Tsou1-20/+0
This includes unknown and unused variables, functions, and non-relevant documentation. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: sigproc: Wrap internal phase on frequency shiftThomas Tsou1-0/+4
The call into table lookup will loop on values outside of the table range. With continuously increasing phase, this leads to an eventual permanent hard spin. Wrap the phase value to prevent that from happening. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Dynamically allocate correlation vectorsThomas Tsou1-6/+10
Stack allocating the correlation output generates a call to the copy constructor of an zero valued vector. We can avoid this extra copy constructor with a pointer reference and dynamic allocation. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Allow separate in/out vectors for delay and decimationThomas Tsou1-51/+62
Allow non-in-place use of the delay setting. Internally, the delay call creates a new vector and copies the contents back into the original. Instead, provide the option to return the computed output vector directly and remove an an extra copy in the process. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Setup sinc() call directly with table lookupThomas Tsou1-2/+23
On Beagle Board the call into the sinc() function is generating a lot of load on the peak interpolation. Simplify the sinc() function with a dedicated table lookup. Eventually, this table may be removed in favour of using a precomputed filterbank for fractional delay determination. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Precompute fractional delay filtersThomas Tsou1-14/+59
Preallocate and compute a bank of fractional sample delay filters. The number of filters to allocate is specified by the DELAYFILTS preprocessor definition with a default value of 64. The filters themselves are sinc pulse generated with 20 taps and Blackman-harris windowed . Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Separate signalVector into it's own fileThomas Tsou1-26/+26
Break out the signalVector object and clean up the interface in the process. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Dynamically allocate convolution input vectorsThomas Tsou1-21/+28
This prevents the use of a copy constructor in the downlink modulator and prevents a secondary memory allocation during the convolution. Avoid both cases by dynamically allocating with preloaded head room. The latter provides enough memory before the first sample in the burst to cover the length of the filter taps. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Add NEON complex-complex multiplyThomas Tsou1-0/+22
Complex-complex block multiples are used for phase rotation of bursts. Optimization targeted from perf profiling. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Add ARM NEON supportThomas Tsou1-2/+15
Similar to the existing Intel SSE cases, add support for NEON vector floating point SIMD processing. In this case, use ARM assembly directly as the NEON intrinsics do not generate preferential code output. Currently support NEON vectorized convolution and floating point integer conversions. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-08Transceiver52M: Remove unused files and utilitiesThomas Tsou1-2/+0
USRPping and sigProcLibTest are in an unmaintained state, while the intended functionality remains unknown. Stored filter taps are also unused and should also be removed. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Setup dual sample rate transceiverThomas Tsou1-68/+133
This patch applies oversampling, when selected with 4 sps, to the downlink only, while running the receiver with minimal sampling at 1 sps. These split sample rates allow us to run a highly accurate downlink signal with minimal distortion, while keeping receive path channel filtering on the FPGA. Without this patch, we oversample the receive path and require a steep receive filter to get similar adjacent channel suppression as the FPGA halfband / CIC filter combination, which comes with a high computational cost. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Generate delay filter with SSE memory alignmentThomas Tsou1-24/+41
This requires an additional memcpy() on the signal vector constructor, but allows the interpolation filter to use SSE optimzationed convolution. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Reduce RACH and TSC correlation windowsThomas Tsou1-8/+8
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>
2013-10-18Transceiver52M: Setup dual Laurent pulse shaping filterThomas Tsou1-44/+211
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>
2013-10-18Transceiver52M: Refactor RACH and normal burst detectionThomas Tsou1-117/+137
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>
2013-10-18Transceiver52M: Add 4 samples-per-symbol Laurent pulse shapeThomas Tsou1-9/+40
When 4 samples-per-symbol operation is selected, replace the existing pulse approximation, which becomes inaccurate with non-unit oversampling, with the primary pulse, C0, from the Laurent linear pulse approximation. Pierre Laurent, "Exact and Approximate Construction of Digital Phase Modulations by Superposition of Amplitude Modulated Pulses", IEEE Transactions of Communications, Vol. 34, No. 2, Feb 1986. Octave pulse generation code for the first three pulses of the linear approximation are included. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Disable energy detectorThomas Tsou1-3/+30
The adaptive energy threshold gating suffers a near-far problem at certain gain levels. This is due to exponential threshold raising, but linear decreases. A large signal level followed by a period low signal level causes (comparatively) weak signals to go undetected. Additionally, the algorithm performs differently at multiple RF gain levels. This patch switches solely to correlation based gating for burst detection. The main computational load with this approach is sub-sample width peak interpolation, which we disable for intial detection and run after threshold passing. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Replace resampler with SSE enabled implementationThomas Tsou1-188/+0
Replace the polyphase filter and resampler with a separate implementation using SSE enabled convolution. The USRP2 (including derived devices N200, N210) are the only supported devices that require sample rate conversion, so set the default resampling parameters for the 100 MHz FPGA clock. This changes the previous resampling ratios. 270.833 kHz -> 400 kHz (65 / 96) 270.833 kHz -> 390.625 kHz (52 / 75) The new resampling factor uses a USRP resampling factor of 256 instead of 250. On the device, this allows two halfband filters to be used rather than one. The end result is reduced distortial and aliasing effecits from CIC filter rolloff. B100 and USRP1 will no be supported at 400 ksps with these changes. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Replace convolve and related calls with SSE implementationThomas Tsou1-349/+295
This large patch replaced the convolve() call with an SSE vector enabled version. The lower C and SSE intrinsic based code operates on fixed and aligned vectors for the filter taps. The storage format of interleaved I/Q for both complex and real vectors is maintained. SSE filter tap values must: 1. Start 16-byte aligned 2. Number with a multiple of 4 between 4 and 20 for real taps 3. Number with a multiple of 4 for complex taps Non-compliant values will fall back to non-SSE usage. Fixed length iterators mean that head and tail cases may require reallocation of the input vector, which is automatically handled by the upper C++ interface. Other calls are affected by these changes and adjusted or rewritten accordingly. The underlying algorithms, however, are unchanged. generateGSMPulse() analyzeTrafficBurst() detectRACHBurst() Intel SSE configuration is automatically detected and configured at build time with Autoconf macros. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Generate RACH correlation sequence at initializationThomas Tsou1-1/+11
There is no temporal dependency on when the RACH sequence is generated, so there is no need for transceiver to create it in response to a command from GSM core. If we power on the transceiver, we will need the RACH sequence, so just allocate it during initialization. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Remove logging from signal processing coreThomas Tsou1-19/+0
The only logging outputs in the the signal processing library are debug lines that generate copious amounts of output while providing little useful information to the user. The relevant information (time-of-arrival, channel gains, etc.) can and should be logged from transceiver instance itself. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Add destructors to correlation seqeunce objectsThomas Tsou1-76/+97
Add destructor calls so we can avoid the nested vector deallocations. Also remove the unnecessary pointer NULL checks prior to destruction. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Make GSM pulse filter internal to implementationThomas Tsou1-68/+67
There is no reason expose the pulse shaping filter outside of the signal processing calls. The main transceiver object makes no use of the filter and there's no reason to pass it around. Initialize the pulse shape with the signal processing library, and maintain an internal static member like many of the other library variables. Similarly destroy the object when the library is closed. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Rename samples-per-symbol variable namesThomas Tsou1-45/+53
Because repeatedly typing mSamplesPerSymbol is giving me carpal tunnel syndrome. Replace with the much shorter, easier to type, and just as clear name of 'sps'. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-06-16Fix build of the Transceiver.Alexander Chemeris1-0/+2
2013-04-04Transceiver52M: Fix calculation of TS correlation for 2 sps and higherttsou1-2/+2
The correlation starting point for normal burst training sequence calculation should be a scaled value of the same symbol regardless of the samples-per-symbol used. Use of 2 samples-per-symbols double the index values, but yields the following outputs, which results in a late time-of-arrival value at the output of the correlation. This patch modifies the parameter calculation accordingly. 1 sps parameters maxTOA = 3 spanTOA = 5; startIx = 61; endIx = 87; windowLen = 26; corrLen = 7; 2 sps parameters (errant case) maxTOA = 6; spanTOA = 10; startIx = 112; endIx = 184; windowLen = 72; corrLen =13; 2 sps parameters (corrected) maxTOA = 6; spanTOA = 10; startIx = 122; endIx = 174; windowLen = 52; corrLen =13; Signed-off-by: Thomas Tsou <tom@tsou.cc> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5183 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-11-26transceiver, resamp: insert missing filter valueskurtis.heimerl1-4/+29
With transceiver integration, the resampling filter files were dropped. This created a working resampling implementation for the USRP2 / N200, but with spectrum irregulaties that likely caused issues at longer range operation. Simply reinsert the filter files and modify the filter initialization to use them. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2689 19bc5d8c-e614-43d4-8b26-e1612bc8e597
2011-10-12Adding in the missing Transceiver52M directorydburgess1-0/+1486
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2307 19bc5d8c-e614-43d4-8b26-e1612bc8e597