File wfm_reader.h¶
FileList > inc > wfm > wfm_reader.h
Go to the source code of this file
Input containers for generated IQ — the dual of wfm_writer. More...
#include <complex.h>#include <stddef.h>#include "wfm/wfm_writer.h"
Classes¶
| Type | Name |
|---|---|
| struct | wfm_reader_info_t |
Public Types¶
| Type | Name |
|---|---|
| typedef struct wfm_reader | wfm_reader_t |
Public Functions¶
| Type | Name |
|---|---|
| void | wfm_reader_close (wfm_reader_t * r) Close the file and free the reader. |
| void | wfm_reader_info (const wfm_reader_t * r, wfm_reader_info_t * info) Copy the resolved capture metadata into info . |
| wfm_reader_t * | wfm_reader_open (const char * path, int hint_sample_type, int hint_endian) Open a capture, auto-detecting its container. |
| size_t | wfm_reader_read (wfm_reader_t * r, float _Complex * out, size_t max) Read up to max complex samples intoout (unit-scalefloat _Complex ), converting from the wire type. Returns the count read; 0 at end of file. |
Detailed Description¶
Reads back what wfm_writer wrote: raw interleaved I/Q, CSV, BLUE type-1000 (attached or detached), and SigMF. The container is auto-detected from the file (BLUE magic / .sigmf-meta sidecar / .csv extension), and self-describing containers (BLUE, SigMF) recover the sample type, byte order, sample rate and centre frequency from their metadata. Headerless containers (raw, CSV) take the sample type / byte order as hints.
Samples come out as float _Complex at unit scale: float wire types are reinterpreted, integer wire types are rescaled by their full-scale (the exact inverse of the writer's quantiser).
wfm_reader_t *r = wfm_reader_open("cap.sigmf-data", 0, 0);
wfm_reader_info_t info;
wfm_reader_info(r, &info); // info.fs, info.sample_type, ...
float _Complex buf[4096];
size_t n;
while ((n = wfm_reader_read(r, buf, 4096)) > 0)
consume(buf, n);
wfm_reader_close(r);
Public Types Documentation¶
typedef wfm_reader_t¶
Opaque reader handle.
Public Functions Documentation¶
function wfm_reader_close¶
Close the file and free the reader.
function wfm_reader_info¶
Copy the resolved capture metadata into info .
function wfm_reader_open¶
Open a capture, auto-detecting its container.
Parameters:
pathfile to read. A BLUE.detor SigMF.sigmf-datadata file resolves its.hdr/.sigmf-metasidecar automatically.hint_sample_typesample type (0..4) for headerless raw/CSV; ignored once BLUE/SigMF metadata is parsed.hint_endianbyte order (0 le, 1 be) for headerless raw.
Returns:
a reader, or NULL on open/parse failure.
function wfm_reader_read¶
Read up to max complex samples intoout (unit-scalefloat _Complex ), converting from the wire type. Returns the count read; 0 at end of file.
The documentation for this class was generated from the following file native/inc/wfm/wfm_reader.h