Skip to content
Snippets Groups Projects
Commit 3d6f45c1 authored by Thomas Jürges's avatar Thomas Jürges
Browse files

Task #11328: Distinguish spectral and transient frame size

The TBB UDP frame sizes in transient and spectral mode are different.  In
spectral mode the frame size is only 2012 bytes where the transient mode has
a frame size of 2040 bytes.  This must be addressed in the code when the
number of samples per frame is calculated.
parent 2e3a00e9
No related branches found
No related tags found
No related merge requests found
...@@ -77,11 +77,14 @@ namespace LOFAR ...@@ -77,11 +77,14 @@ namespace LOFAR
* In the TBBs, transient samples are packed (2 samples per 3 bytes) with the checksum all the way at the end. This changes on transfer. * In the TBBs, transient samples are packed (2 samples per 3 bytes) with the checksum all the way at the end. This changes on transfer.
* *
* TBB stores a frame in 2040 bytes (actually, 2048 with preamble and gaps). It sends a frame at a time, so derive our max from it. * TBB stores a frame in 2040 bytes (actually, 2048 with preamble and gaps). It sends a frame at a time, so derive our max from it.
*
* In spectral mode the frame size is only 2012 bytes!
*/ */
#define MAX_TBB_DATA_SIZE (2040 - sizeof(TBB_Header) - sizeof(uint32_t)) // 1948: TBB frame size without header and payload crc32. #define MAX_TBB_DATA_SIZE_SPECTRAL_MODE (2012 - sizeof(TBB_Header) - sizeof(uint32_t))
#define MAX_TBB_DATA_SIZE_TRANSIENT_MODE (2040 - sizeof(TBB_Header) - sizeof(uint32_t)) // 1948: TBB frame size without header and payload crc32.
#define MAX_TBB_TRANSIENT_NSAMPLES (MAX_TBB_DATA_SIZE / 3 * 2) // 1298 (.666: 1 byte padding when indeed 1298 samples would ever be stored in TBB) #define MAX_TBB_TRANSIENT_NSAMPLES (MAX_TBB_DATA_SIZE_TRANSIENT_MODE / 3 * 2) // 1298 (.666: 1 byte padding when indeed 1298 samples would ever be stored in TBB)
#define MAX_TBB_SPECTRAL_NSAMPLES (MAX_TBB_DATA_SIZE / (2 * sizeof(int16_t))) // 487 #define MAX_TBB_SPECTRAL_NSAMPLES (MAX_TBB_DATA_SIZE_SPECTRAL_MODE / (2 * sizeof(int16_t))) // 487
// Unpacked, sign-extended (for transient) samples without padding, i.e. as received. // Unpacked, sign-extended (for transient) samples without padding, i.e. as received.
// Frames might not be full; the doc says the crc32 is always sent right after (no padding), // Frames might not be full; the doc says the crc32 is always sent right after (no padding),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment