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

SW-546: When necessary add one spectral sample to the offset in spectral mode

parent 88a26638
No related branches found
No related tags found
No related merge requests found
......@@ -469,6 +469,50 @@ namespace LOFAR
<< sliceNr << ", "
<< itsDumpInfo.itsSliceNr0);
/**
* Now check for even/odd seconds. Why? Because
* sampling frequency / (N * 1024) does not result in an integer without
* rest. So one 1024 slice has to be moved to either ever odd or to
* every even second:
*
* slice #195312 slice #195313 slice #0
* | | |
* v v v
* 1024 ---------|--------- 1024 --------- |--------- 1024
* ^
* |
* A new odd second begins here.
*
* slice #195312 slice #0 slice #1
* | | |
* v v v
* 1024 ---------|--------- 1024 --------- |--------- 1024
* ^
* |
* A new even second begins here.
*
* What does this all mean?
* ------------------------
* If the time-stamp of the second of the first frame is even then
* the last frame had slice numbers up to #195313.
* The following slice numbers for the next second will only go up to
* #195312.
* - Check if the frame #0's second is even, then
* - check if the second of the current frame is odd.
* - Both yes: means that we have to add one sample to the offset.
*/
if((itsDumpInfo.itsTime0 % 2 == 0) && (frame.header.time % 2 == 1))
{
offset += 1;
LOG_INFO_STR("TBB: Added one sample to the offset because t0 is "
"even and t_now is odd: itsDumpInfo.itsTime0 = "
<< itsDumpInfo.itsTime0
<< ", frame.header.time = "
<< frame.header.time
<< ", offset = "
<< offset);
}
/**
* Flag lost frame(s) (assumes no out-of-order).
* Assumes all frames (except maybe the last) have the same nr of samples (fine).
......
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