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

SW-546: Add comments describing how the offset is calculated

parent 50d31ceb
No related branches found
No related tags found
No related merge requests found
...@@ -316,14 +316,33 @@ namespace LOFAR ...@@ -316,14 +316,33 @@ namespace LOFAR
* first received frame. * first received frame.
*/ */
uint64_t offset = frame.header.time - itsDumpInfo.itsTime0; uint64_t offset = frame.header.time - itsDumpInfo.itsTime0;
// Convert the offset in [s] to bytes. sampleFreq is in MHz. /**
* Convert the offset in [s] to samples containing a complex numbers of
* two 16 bit integers. sampleFreq is in MHz.
*/
offset *= (frame.header.sampleFreq * 1000000U); offset *= (frame.header.sampleFreq * 1000000U);
/** /**
* Divide the offset by the size of an FFT block. The result is an index * Divide the offset, i.e. the number of samples by the size of an FFT
* for the current data frame. * block. The result is the index of the raw voltage sampling window
* (size 1024 values) that got fed into the FFT. This not a sample within
* the window but just a rough indicator which window we are in!
* [ 1024 ][ 1024 ][ 1024 ]
* ^
* | Start recording
* ^
* | Window number of the 0th TBB data frame
* ^
* | Window number of frame N
* This is also then the index of the TBB frame for this frequency because
* the begin of a voltage window is also the begin of a frequency window.
*/ */
offset /= SPECTRAL_TRANSFORM_SIZE; offset /= SPECTRAL_TRANSFORM_SIZE;
/**
* Now try to figure out where in the raw voltage data window our spectral
* frame exactly begins.
*/
/** /**
* NOTE: * NOTE:
* untested body: when can I have enough test data from a working * untested body: when can I have enough test data from a working
...@@ -343,6 +362,10 @@ namespace LOFAR ...@@ -343,6 +362,10 @@ namespace LOFAR
* second: * second:
* 1 extra slice fitted in that second * 1 extra slice fitted in that second
*/ */
/**
* TODO
* Is this still needed? Sander/Thomas need to look into this.
*/
offset += 1; offset += 1;
// avoid duplicate offset compensation next // avoid duplicate offset compensation next
time0 += 1; time0 += 1;
......
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