iq_sdk
¶
Dataloaders and utilities for I/Q radio recordings.
Usage¶
Loading a receiver¶
Receiver reads I/Q data from a single receiver directory
produced by the recording format. Pass the path to the rx*
subdirectory and, optionally, an interval controlling how many samples are
returned per item.
from iq_sdk import Receiver
# Default interval — one item per capture (samples_per_capture samples each).
rx = Receiver("data/lab_noise/rx0")
# Custom interval — 4096 samples per item.
rx = Receiver("data/lab_noise/rx0", interval=4096)
Indexing¶
Receiver implements the
abstract-dataloader
Sensor protocol, so items are accessed by
integer index:
sample = rx[0] # IQData[np.ndarray]
print(sample.iq) # complex64 array, shape (1, interval)
print(sample.timestamps) # float64 array, shape (1,)
Iterating¶
Inspecting metadata¶
All receiver-level state is stored in rx.metadata:
meta = rx.metadata
print(meta.interval) # samples per item
print(meta.total_samples) # total I/Q samples in the recording
print(meta.samples_per_chunk) # samples per on-disk chunk file
print(meta.chunks) # sorted list of chunk file paths
print(meta.timestamps) # float64 array, one epoch second per item
iq_sdk.IQData
¶
iq_sdk.Receiver
¶
Bases: Sensor[IQData, ReceiverMetadata]
Sensor for reading I/Q data from a receiver directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the receiver directory (e.g. |
required |
interval
|
int | None
|
Number of I/Q samples returned per |
None
|
name
|
str
|
Sensor name passed to the base class. |
'rx'
|
Source code in src/iq_sdk/dataloader.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
__getitem__
¶
Return one interval of I/Q samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | integer
|
Sample index (0-based). |
required |
Returns:
| Type | Description |
|---|---|
IQData[ndarray]
|
|
Source code in src/iq_sdk/dataloader.py
iq_sdk.ReceiverMetadata
¶
Metadata for a Receiver sensor.
Attributes:
| Name | Type | Description |
|---|---|---|
timestamps |
Float64[ndarray, ' n']
|
Unix epoch timestamp (seconds) for the start of each interval, interpolated from per-capture timestamps. |
chunks |
list[str]
|
Chunk file paths, sorted by numeric index. |
samples_per_chunk |
int
|
Number of I/Q samples in each chunk. |
total_samples |
int
|
Total number of I/Q samples in the recording. |
interval |
int
|
Number of I/Q samples per |