Skip to content
Snippets Groups Projects
Commit a83d50db authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #8264: Updated 4-bit scaling to 64x

parent b91e97b3
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,9 @@ inline __device__ float convertIntToFloat(signed char x)
// Extract the 4-bit real or imaginary part of an 8-bit input sample
inline __device__ signed char extractRI(signed char x, bool imag)
{
return imag ? x >> 4 : (x << 4) >> 4; // preserve sign
// Note 1: Imaginary part is in the top 4 bits. See also RSP::decode4bit() in InputProc/Station/RSP.h.
// Note 2: Preserve the sign, so use sign-extending shifts to extract the right bits.
return imag ? x >> 4 : (x << 4) >> 4;
}
// WARNING: Caller is responsible for extracting 4-bit real or imaginary part from sample byte
......@@ -63,9 +65,7 @@ inline __device__ float convertIntToFloat(signed char x)
// TODO: Is this the right scaling for 4-bit mode?
// Keep output scale the same as 16 bit mode.
// Gains (input and complex voltages) end up x16,
// power (visibilities and Stokes) end up x16^2.
return 16 * i;
return 64 * i;
}
#else
#error unsupported NR_BITS_PER_SAMPLE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment