Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
SimTX Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
SimTX API/Packets/IqBlock
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{SimTX API navigation}} {{SimTX packet | name = IqBlock | frame = ServerFrame | field = 12 | member = iq | direction = s2c | session = [[SimTX API/Receiver session|Receiver]] | roles = <code>ROLE_RECEIVER</code>. | permission = None | group = receiver | file = session.proto }} '''IqBlock''' carries one block of received complex baseband samples. A receiver gets a continuous stream of them after the [[SimTX API/Packets/IqStreamDescriptor|IqStreamDescriptor]], at the rate of the simulation. With <code>timestamped</code> set in the [[SimTX API/Packets/ReceiverStart|ReceiverStart]], every block also carries the UTC instant of its first sample. == Definition == <syntaxhighlight lang="protobuf"> message IqBlock { float scale = 1; bytes samples = 2; int64 first_sample_epoch_seconds = 3; // timestamped streams only int32 first_sample_nanos = 4; fixed64 sequence = 5; } </syntaxhighlight> == Fields == {| class="wikitable" ! # !! Field !! Type !! Description |- | 1 || <code>scale</code> || <code>float</code> || Scale of this block: the peak component magnitude, at least 10<sup>β9</sup>. |- | 2 || <code>samples</code> || <code>bytes</code> || <code>chunk_samples</code> Γ (I, Q), interleaved, big-endian <code>int16</code> (or <code>int8</code>). Length is exactly <code>chunk_samples Γ 2 Γ 2</code> (or <code>Γ 1</code>) bytes. |- | 3 || <code>first_sample_epoch_seconds</code> || <code>int64</code> || Timestamped streams only: UTC instant of the first sample on the server's RF timeline, Unix seconds. |- | 4 || <code>first_sample_nanos</code> || <code>int32</code> || Nanoseconds added to <code>first_sample_epoch_seconds</code>. |- | 5 || <code>sequence</code> || <code>fixed64</code> || Block number within the stream: 1 for the first block, +1 for each block after it. A step larger than 1 means blocks were dropped. 0 = the sender does not number blocks. |} == Decoding == <syntaxhighlight lang="text"> I = i_raw Γ scale / 32767 (INT16; use 127 for INT8) Q = q_raw Γ scale / 32767 </syntaxhighlight> * The sample bytes are big-endian, unlike the rest of the frame, which follows protobuf encoding. * Check that <code>samples</code> is exactly <code>chunk_samples Γ 2 Γ bytesPerComponent</code> bytes long and treat anything else as a protocol error. * <code>scale</code> is the block's peak component magnitude. The server quantises each component as <code>round(x Γ 32767 / scale)</code>, so the integers always use the full range. * A magnitude of 1.0 is β12 dBm at the receiver input. Components are clipped at Β±1.0 before quantisation, so strong signals overload the receiver. == Delivery == * Blocks are sent in real time. The server queues at most 8 blocks per connection and drops the oldest when the queue is full. * <code>sequence</code> counts blocks from 1 and continues across retunes. A step larger than 1 means blocks were dropped. A sender that does not number blocks sends 0. * <code>sequence</code> is a <code>fixed64</code>, so it occupies 9 bytes of the frame (tag and 8 bytes) even when small. * A client that does not read for 5 seconds is disconnected. == Examples == Complete frames, including the varint length prefix. '''<code>iq_block_int16</code>''' (server to client, 27 bytes): <syntaxhighlight lang="text"> 1A frame length 26 62 18 iq (IqBlock), 24 bytes 0D 00 00 00 3F scale = 0.5 12 08 7F FF 80 01 40 00 C0 00 samples, 8 bytes 29 01 00 00 00 00 00 00 00 sequence = 1 </syntaxhighlight> '''<code>iq_block_int16_timestamped</code>''' (server to client, 38 bytes): <syntaxhighlight lang="text"> 25 frame length 37 62 23 iq (IqBlock), 35 bytes 0D 00 00 00 3F scale = 0.5 12 08 7F FF 80 01 40 00 C0 00 samples, 8 bytes 18 C0 84 FC D6 06 first_sample_epoch_seconds = 1793000000 20 95 9A EF 3A first_sample_nanos = 123456789 29 02 00 00 00 00 00 00 00 sequence = 2 </syntaxhighlight> == See also == * [[SimTX API/Receiver session#Decoding samples|Decoding samples]] * [[SimTX API/Quick start]] {{SimTX API navbox}} [[Category:SimTX API]]
Summary:
Please note that all contributions to SimTX Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
SimTX Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:SimTX API navbox
(
edit
)
Template:SimTX API navigation
(
edit
)
Template:SimTX packet
(
edit
)