Commit graph

12 commits

Author SHA1 Message Date
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Tom Tsou
0e9f204029 convert: Add SSE implementation for sc12
Implementation uses SSSE3 intructions to perform 12-bit
sample pack/unpack operations to/from standard 16 and 32
bit host values. Input/output shuffle orderings for a
single 128-bit SSE register with 16-bit integers shown
below.

   16-bit interleaved I/Q
  ---------------------------------------
 | Q3 | I3 | Q2 | I2 | Q1 | I1 | Q0 | I0 | Input
  ---------------------------------------
 | 127                                 0 |

     12-bit packed I/Q byteswapped
      -----------------------
     |   I0   |   Q0   |  I1 | 0
     |-----------------------|
     | I1 |  Q1  |  I2  | Q2 |             Output
     |-----------------------|
     | Q2  |   I3   |   Q3   |
     |-----------------------|
     |        Unused         | 3
      -----------------------
     31                     0

Fixes: #1740, #966
Related: #1739
2017-07-25 10:15:37 -07:00
Tom Tsou
f21874e68a convert: Add sc12-sc16 converters
Create missing sc12-sc16 and sc16-sc12 type converters. To avoid
replicating the full sc12 converter class object, overload the
converter calls with C++11 std::enable_if metafunctions. When
used with std::is_floating and std::is_integral templates, this
allow a single template interface with compile time function
selection and static type checking.

Note the below std::enable_if interface is confusing, but quite
effective in this case.

  typename enable_if<is_floating_point<type>::value>::type* = NULL

Fixes: #966
Related: #967, #1721
2017-07-18 12:45:56 -07:00
Andrej Rode
21aad77c9c utils: introduce new logging API and remove msg API 2017-02-20 17:13:15 -08:00
Martin Braun
99c2730bc9 Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
  stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
  compilers support that).
2016-11-08 08:02:22 -08:00
Martin Braun
9caf20c299 converters: Clarifying comment re packing 2016-06-22 19:08:19 -07:00
Tom Tsou
2a54f8e291 convert: Fix sc12 unpack shifting
Resolve issue #666 "B200: Rx signal distortion when using SC12".

During 12-bit unpacking, OTW samples are shifted into the high order
bits of the 16-bit intermediate values. The remaining 4-bits are not
zeroed and contain bits from adjacent samples. Consequently, signal
distortion becomes noticable with spurs and other random signal
garbage when operating at low signal levels.

Signed-off-by: Tom Tsou <tom@tsou.cc>
2015-01-12 10:54:09 +01:00
Ben Hilburn
9e47ad607b Squashed merge of Coverity fixes. 2013-11-27 12:11:23 -08:00
Johannes Demel
c6657b831d sc12: fixed byte alignment issue 2013-11-19 12:00:40 -08:00
Josh Blum
2d4c77489f convert: added sc12 and fc32 converters 2013-08-28 17:07:36 -07:00