Add --iformat option that controls the format of the data read from --ifile.

This currently understands:

UC8 (original rtl_sdr format, 8-bit unsigned complex);
SC16 (16-bit signed complex, full width);
SC16Q11 (bladeRF native format: 16-bit signed complex with 11 bits of magnitude)
This commit is contained in:
Oliver Jowett 2015-05-29 18:13:47 +01:00
parent 0bd897cad1
commit 079de99eec
2 changed files with 80 additions and 10 deletions

View file

@ -250,6 +250,8 @@ struct mag_buf {
uint32_t dropped; // Number of dropped samples preceding this buffer
};
typedef enum { INPUT_UC8=0, INPUT_SC16, INPUT_SC16Q11 } input_format_t;
// Program global state
struct { // Internal state
pthread_t reader_thread;
@ -265,6 +267,7 @@ struct { // Internal state
unsigned trailing_samples; // extra trailing samples in magnitude buffers
int fd; // --ifile option file descriptor
input_format_t file_format; // --iformat option
uint16_t *maglut; // I/Q -> Magnitude lookup table
uint16_t *log10lut; // Magnitude -> log10 lookup table
int exit; // Exit from the main loop when true