aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterfaceResamp.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-09-20radioInterface: Atomically fetch and change underrun variablePau Espin Pedrol1-2/+2
Otherwise, it could happen that underrun events are lost: TxLower (isUnderrun): RxLower (pullBuffer): read(underrun) read(underrun) write(underrun, |val) [maybe underrun becomes TRUE] write(underrun, false) Similary, it could happen the other direction if atomic was only applied to isUnderrun: TxLower (isUnderrun): RxLower (pullBuffer): read(underrun) -> true read(underrun)-> true write(underrun, false) write(underrun, true|val) where val=false So in here isUnderrun would return true twice while it should only return one. Change-Id: I684e0a5d2a9583a161d5a6593559b3a9e7cd57e3
2019-09-13radioInterface{Multi,Resamp}: Fix successful writeSamples() masking underrun ↵Pau Espin Pedrol1-1/+3
from readSamples() The only who should be setting class instance value "underrun" to false is isUnderrun(). Similar fixes were already applied lately to radioInterface.cpp. Change-Id: I3239b1df4536c080365106b3e4daa523b57f5dff
2019-09-13radioInterface: Rename mRadio to mDevicePau Espin Pedrol1-4/+4
Previous naming is ready confusing, because "Radio" is actually the common term between radioInterface and radioDevice, and it looks like it's referring to radioInterface rather than radioDevice. On the other hand, mDevice cleary states it refers to the radioDevice item. Change-Id: I708bb1992a156fb63334f5590f2c6648ca27495e
2019-07-22Add SPDX annotationPau Espin Pedrol1-0/+2
Related: OS#3515 Change-Id: I3719bd8dc015569ecd81928fc079e27593cdca09
2018-09-03radioInterface: forward errors from RadioDevice to Transceiver in recv pathPau Espin Pedrol1-3/+4
Change-Id: Id7b08b19d6575c79b4d57db656a17ff05bb61ee9
2016-07-20uhd: Update USRP2/N200/N210 for 4 SPS RxTom Tsou1-16/+5
Requires changing the radioInterface API to pass in Rx side SPS value. Update the (deprecated) diversity configuration to match as well. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-01iface: Add inner ring-buffer implementationTom Tsou1-48/+33
Two buffers, inner and outer, are used in the transceiver implementation. The outer buffer interfaces with the device receive interface to guarantee timestamp aligned and contiguously allocated sample buffers. The inner buffer absorbs vector size differences between GSM bursts (156 or 157 samples) and the resampler interface (typically fixed multiples of 65). Reimplement the inner buffer with a ring buffer that allows fixed size segments on the outer (resampler) portion and variable lengths (GSM side) on the inner side. Compared to the previous stack-like version, this implementation removes unnecessary copying of buffer contents. Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2013-11-18Transceiver52M: Add missing scaling vector resizeThomas Tsou1-0/+1
Downlink scaling factors, which are stored in a vector for multiple channels, was not being sized correctly. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Use independent power scaling varables for each channelThomas Tsou1-1/+1
Simply vectorize the existing power state variable. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Add dual channel diversity receiver optionThomas Tsou1-9/+7
This patch add support for dual channel diversity on the receive path. This allows two antennas two shared antennas to be used for each ARFCN handling channel in the receiver. This configuration may improvde performance in multi-path fading environments, however, noise andpotential interference levels are increased due to the higher bandwidth used. The receive path is oversampled by a factor of four for a rate of 1.083333 Msps. If the receive paths are tuned within a maximum channel spacing (currently set at 600 kHz), then both ARFCN frequencies are processed by each channel of the receiver. Otherwise, the frequency shifted diversity path is disabled and standard non-diversity operation takes place. Diversity processing is handled by selecting the path with the higheset energy level and discarding the burst on the second path. Selection occurs on a burst-by-burst basis. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-11-15Transceiver52M: Add multi channel transceiver supportThomas Tsou1-13/+24
This patch primarily addresses devices with multiple RF front end support. Currently device support is limited to UmTRX. Vectorize transceiver variables to allow multiple asynchronous threads on the upper layer with single downlink and uplink threads driving the UHD I/O interface synchronously. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Deallocate high level resources on shutdownThomas Tsou1-2/+4
This primarily addresses the error case at initialization. In the event that the transceiver fails to start, we should be able cleanly shutdown and release while providing a useful reason for exiting. After the radio is started and threads launched, there are no thread state variables or shutdown messaging between threads, and the transceiver cannot be consistently shutdown. This issue remains to be solved. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Reduce and place bounds checking on I/O buffersThomas Tsou1-21/+33
Previous send and receive buffers at the radio interface were arbitrarily set to a sufficient size. For normal (non-resampling) devices, use a block (chunk) size of 625 samples. For 64 or 100 MHz resampling devices, use 4 times the reduced resampling numerator or denominator and provide bounds checking where appropriate. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Add 64 MHz resampling option with B100Thomas Tsou1-20/+46
Move B100 to the resampling interface with default clocking. This temporarily resolves undetermined FPGA clocking issues. This also provides extensible support for multiple clocking rates and resampling ratios. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Setup dual sample rate transceiverThomas Tsou1-11/+3
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: Narrow resampling filter bandwidthThomas Tsou1-8/+11
This patch only applies to resampling use at 4 samples-per-symbol. By extention that means only USRP2 / N2xx devices are affected. At 4 samples-per-symbol we restrict output bandwidth to roughly roughly 700 MHz, which combined with the 2 pulse Laurent approximation yields < 0.5 degrees of RMS phase error at the resampler output. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Add SSE floating point / integer conversionThomas Tsou1-19/+5
Convertions are performed in multiples of 4 or 8. All loads are considered unaligned. Signed-off-by: Thomas Tsou <tom@tsou.cc>
2013-10-18Transceiver52M: Replace resampler with SSE enabled implementationThomas Tsou1-249/+146
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: Set resampling option automatically based on deviceThomas Tsou1-0/+332
Remove the built time resampling selection and link both options. Move the normal push/pullBuffer() calls back to the base class and overload them in the inherited resampling class. USRP2/N2xx devices are the only devices that require resampling so return that resampling is necessary on the device open(), which is the point at which the device type will be known. The GSM transceiver only operates at a whole number multiple of the GSM rate and doesn't care about the actual device rate and if resampling is used. Therefore GSM specific portion of the transceiver should only need to submit the samples-per-symbol value to the device interface. Then, the device should be able to determine the appropriate sample rate (400 ksps or 270.833 ksps) and if resampling is appropriate. Signed-off-by: Thomas Tsou <tom@tsou.cc>