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 ) {