Searching \ for ' M and S sequences' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=sequences
Search entire site for: 'M and S sequences'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] M and S sequences'
2002\04\29@214905 by ali dawji

picon face
dear Sir,

Thank you for your replay,

you are correct sir, this cross-correlation computation between two digital
sequences,
1-The purpose of this calculation to calculate the highest value found form
the correlation, but later I want to use the position of the highest
value(for example: the highest value comes from first or second or third
or???. Calculation).
2-The original input data is digital signal with 1 or 0 , but later I will
change this to 1 or -1 only, so all the input values are 1 or -1  only.
3- Yes Sir, as I mentioned before I want to know the position in the M
sequence where the highest vale of Ax occurs.
4-the speed is important, but I do not understand the meaning of size of the
code.
5- Unfortunately I am not familiar with any programming language except a
little knowledge of C, and I am start already to Study a little about C++. I
sue personal computer.
6- The sequence M is known already, I mean the element of this sequence is
decided already, and should  be written in the program body as a known
sequence, in other hand, the sequence S is changeable so should be inter by
the user as sequence consist of nine element or number.

I hope my explanation is enough












{Quote hidden}

>{Original Message removed}

2002\04\29@214911 by ali dawji

picon face
dear Sir,

Thank you for your replay,

you are correct sir, this cross-correlation computation between two digital
sequences,
1-The purpose of this calculation to calculate the highest value found form
the correlation, but later I want to use the position of the highest
value(for example: the highest value comes from first or second or third
or???. Calculation).
2-The original input data is digital signal with 1 or 0 , but later I will
change this to 1 or -1 only, so all the input values are 1 or -1  only.
3- Yes Sir, as I mentioned before I want to know the position in the M
sequence where the highest vale of Ax occurs.
4-the speed is important, but I do not understand the meaning of size of the
code.
5- Unfortunately I am not familiar with any programming language except a
little knowledge of C, and I am start already to Study a little about C++. I
sue personal computer.
6- The sequence M is known already, I mean the element of this sequence is
decided already, and should  be written in the program body as a known
sequence, in other hand, the sequence S is changeable so should be inter by
the user as sequence consist of nine element or number.

I hope my explanation is enough












{Quote hidden}

>{Original Message removed}

2002\04\29@223659 by Bob Ammerman

picon face
The solution outlined below is appropriate for a PC-based based solution
with little constraint on available memory for data and code. It is designed
to be as fast as possible.

It makes extensive use of the preprocessor to do as much work as possible at
compile time.

I would estimate this will take less than 10 microseconds on a 1GHz PC.

// The following array can be indexed by any
// 9-bit number from 0 thru 511 to return the
// number of one bits set in that number:

int    bit_count[512] = {
  0,        // 0 = 000 000 000 binary
  1,        // 1 = 000 000 001 binary
  1,        // 2 = 000 000 010 binary
  2,        // 3 = 000 000 011 binary
  1,        // 4 = 000 000 100 binary
  2,        // 5 = 000 000 101 binary
  2,        // 6 = 000 000 110 binary
  3,        // 7 = 000 000 111 binary
  .....
  8,        // 510 = 111 111 110 binary
  9        //  511 = 111 111 111 binary
};

// The following macros define the bits of the M sequence

#define M1    1
#define M2    1
#define M3    0
#define M4    1
...
#define M511 0

// Define a macro to combine 9 bits of M into a
// single 9-bit mask value

#define MASK(a,b,c,d,e,f,g,h,i)
   ( (a) << 8 ) | ((b) << 7) | ((c) << 6) | ((d) << 5) |         \
   ( (e) << 4 ) | ((f) << 3) | ((g) << 2 ) | ((h) << 1) | (i)

// Define values for each 9 bit consecutive group of bits in the M sequence

#define M_1_9 MASK(M1,M2,M3,M4,M5,M6,M7,M8,M9)
#define M_2_10 MASK(M2,M3,M4,M5,M6,M7,M8,M9,M10)
....
#define M_503_511 MASK(M503,M504,M505,M506,    \
           M507,M508,M509,M510,M511)

   int    S;                    // the sequence S expressed as a 9 bit
binary value

// Set  best to the number of matching bits when comparing S to the
// first 9 bits of M (ie: compute A0).
// Remember where we found this 'best' value.

   int    best = bit_count[ S ^ M_1_9 ];
   int    bestpos = 0;

// Now, for each possible offset into the M-stream compute
// the number of matching bits and see if it is better than the best
// we have so far. If it is, remember the new best value and where we
// found it.

   if ( bit_count[ S ^ M_2_10 ] > best )
   {
       best = bit_count[ S ^ M_2_10 ];
       bestpos = 1;
   }

   if ( bit_count[ S ^ M_3_10 ] > best )
   {
       best = bit_count[ S ^ M_3_10 ];
       bestpos = 2;
   }
   ....

   if ( bit_count[ S ^ M_503_511 ] )
   {
       best = bit_count[ S ^ M_502_511 ];
       bestpos = 501;
   }

> >{Original Message removed}

2002\04\30@133358 by Andrew Warren

flavicon
face
Bob Ammerman <@spam@PICLISTKILLspamspammitvma.mit.edu> wrote:

> The solution outlined below is appropriate for a PC-based based
> solution with little constraint on available memory for data and
> code. It is designed to be as fast as possible.

Bob:

Would it work better if there were an "S = ~S;" before the
comparisons... Or if the bit_count[] array were rewritten to hold the
number of zeroes in each number?

-Andy

=== Andrew Warren -- KILLspamaiwKILLspamspamcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\04\30@190722 by Bob Ammerman

picon face
----- Original Message -----
From: "Andrew Warren" <spamBeGoneaiwspamBeGonespamCYPRESS.COM>
To: <TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Sent: Tuesday, April 30, 2002 1:35 PM
Subject: Re: M and S sequences


{Quote hidden}

Or if the values for M were inverted

Or if the macro that builds a mask inverted the bits

Oops.....

Bob


{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...