+- +-
Say hello if visiting :) by Gecko
11 Jan 2023, 07:43:05 pm

Seti is down again by Mike
09 Aug 2017, 10:02:44 am

Some considerations regarding OpenCL MultiBeam app tuning from algorithm view by Raistmer
11 Dec 2016, 06:30:56 am

Loading APU to the limit: performance considerations by Mike
05 Nov 2016, 06:49:26 am

Better sleep on Windows - new round by Raistmer
26 Aug 2016, 02:02:31 pm

Author Topic: Code documentation - newby question  (Read 10487 times)

Kavanagh

  • Guest
Code documentation - newby question
« on: 14 May 2009, 09:32:52 am »
Hello all,
I am attempting to write a program that analyses S@H work units. After one hour on the S@H site I am unable to find the documentation on binary data representation. I would be much obliged for a URL.
Richard Kavanagh

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: Code documentation - newby question
« Reply #1 on: 14 May 2009, 09:39:33 am »
If you willfind such document it woud be great.
th simplest way if not -to read the source in part where it loads workunit  structures into memoy. Some comments about fields loaded could help too.

Kavanagh

  • Guest
Re: Code documentation - newby question
« Reply #2 on: 14 May 2009, 02:09:31 pm »
I am stymied by the following in s_util.cpp

// see the doc on binary data representation

void bits_to_floats(unsigned char* raw, sah_complex* data, int nsamples) {
  int i, j, k=0;
  unsigned char c;

  for (i=0; i<nsamples/4; i++) {
    j = (i&1) ? i-1 : i+1;
    c = raw[j];
    for (j=0; j<4; j++) {
      data[k][0] = (float)((c&2)?1:-1);
      data[k][1] = (float)((c&1)?1:-1);
      k++;
      c >>= 2;
    }
  }
}

I cannot find the binary data representation document and cannot find the definition of  sah_complex. Any pointers?
Richard


Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: Code documentation - newby question
« Reply #3 on: 14 May 2009, 02:14:30 pm »
If you follow the definitions, using visual studio's built in 'go to definition' feature, you should find that 'sah_complex' is defined in 's_util.h' as:

typedef float sah_complex[2];

the first float being the real part of a complex single precision value, and the second float being the imaginary part.  This is standard arrangement for a single precision complex numerical value.

The splitter bits to float functionality, is derived directly from radio techniques using some quadrature encoding technique beyond my skill base (otherwise known as 'black magic').  I would not be surprised, though, if Arecibo and Berkeley's methods used in those mechanisms were unique in their encoding schemes, given the age of the installation, and the numerous upgrades & refinements over the years.
« Last Edit: 14 May 2009, 02:23:18 pm by Jason G »

Kavanagh

  • Guest
Re: Code documentation - newby question
« Reply #4 on: 15 May 2009, 04:29:37 am »
If you follow the definitions, using visual studio's built in 'go to definition' feature, you should find that 'sah_complex' is defined in 's_util.h' as:

typedef float sah_complex[2];


You unobservant eejit Kavanagh. >:(  I should have been able to infer that from the code anyway.

Thank you Jason.

Richard

 

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?
Members
Total Members: 97
Latest: ToeBee
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 59559
Total Topics: 1672
Most Online Today: 250
Most Online Ever: 983
(20 Jan 2020, 03:17:55 pm)
Users Online
Members: 0
Guests: 234
Total: 234
Powered by EzPortal