aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Walters <mike@flomp.net>2020-08-05 21:06:25 +0100
committerEric Wild <ewild@sysmocom.de>2020-08-09 14:48:49 +0200
commitbd668e97b632e68a131df738cc5aee49fc9df3e4 (patch)
tree0b16db0f9e01f36642c94bc48248bd91ebcf76cb
parent911082ff85dd3bdff986b8928b041644b3824e72 (diff)
HackRF: fix hackrf_source signednessv0.2.2
The LUT changes in 2e7d343fed inadvertently started interpreting samples as unsigned. This change puts it back to signed (and fixes an outdated comment). Signed-off-by: Eric Wild <ewild@sysmocom.de>
-rw-r--r--lib/hackrf/hackrf_common.h2
-rw-r--r--lib/hackrf/hackrf_source_c.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/hackrf/hackrf_common.h b/lib/hackrf/hackrf_common.h
index ea093b9..bb553c3 100644
--- a/lib/hackrf/hackrf_common.h
+++ b/lib/hackrf/hackrf_common.h
@@ -34,7 +34,7 @@
#define BUF_LEN (16 * 32 * 512) /* must be multiple of 512 */
#define BUF_NUM 15
-#define BYTES_PER_SAMPLE 2 /* HackRF device produces/consumes 8 bit unsigned IQ data */
+#define BYTES_PER_SAMPLE 2 /* HackRF device produces/consumes 8 bit signed IQ data */
#define HACKRF_FORMAT_ERROR(ret, msg) \
boost::str( boost::format(msg " (%1%) %2%") \
diff --git a/lib/hackrf/hackrf_source_c.cc b/lib/hackrf/hackrf_source_c.cc
index 4f2fb78..662d04a 100644
--- a/lib/hackrf/hackrf_source_c.cc
+++ b/lib/hackrf/hackrf_source_c.cc
@@ -88,7 +88,7 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
// create a lookup table for gr_complex values
for (unsigned int i = 0; i <= 0xff; i++) {
- _lut.push_back( float(i) * (1.0f/128.0f) );
+ _lut.push_back( float(int8_t(i)) * (1.0f/128.0f) );
}
if ( BUF_NUM != _buf_num || BUF_LEN != _buf_len ) {