difx:difx2.0statbased

Many operations within the correlator require a phase rotation of complex data. Given a phase, one converts this into a complex value which can be applied using a complex multiplication by taking the sin/cos of the phase, and assembling the result into a complex number using complexval = cos + i sin. All pretty straightforward.

In DiFX1.5, anywhere such a phase rotation was needed, the sin/cos was taken for every point of the data, as shown in the diagram below.

However, in most situations, the phase increment from one sample (or one channel) to the next is a constant amount. (The exception to this, quadratic approximations for fringe rotation, is handled in a piecewise linear fashion, which uses essentially the same approach as described below, with one extra step I won't detail here). When this is the case, it is unnecessary to calculate the sin/cos for every single sample/channel of the N you have. You can do one stretch of M samples/channels, then do every Mth sample/channel after that, and fill in the gaps by complex multiplying the first M channels with every Mth channel as shown below:

This slashes the number of sin/cos operations needed, which is a big saving because they are actually rather expensive. Rather than doing N sin/cos operations, you are now doing M + N/M. For N=1024 and M=32, that means you are doing 64 instead of 1024 - a saving of a factor of 16. The complex multiplications to fill in the gaps are much cheaper and can be considered virtually negligible. In DiFX1.5, sin/cos operations dominate the station-based cost; in DiFX2.0, the FFT dominates, which is as it should be.

difx/difx2.0statbased.txt · Last modified: 2015/10/21 10:08 by 127.0.0.1