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

dear Sir,
Thank you for your replay,
you are correct sir, this crosscorrelation computation between two digital
sequences,
1The 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).
2The 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.
4the 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}>From: Bob Ammerman <
spam_OUTrammermanTakeThisOuTADELPHIA.NET>
>ReplyTo: pic microcontroller discussion list <
.....PICLISTKILLspam@spam@MITVMA.MIT.EDU>
>To:
PICLISTKILLspamMITVMA.MIT.EDU
>Subject: Re: M and S sequences
>Date: Mon, 29 Apr 2002 07:15:23 0400
>
>This looks like some sort of correlation computation.
>
>A couple of questions:
>
>1. Do you need to keep the individual values of A0, A1, A2, A3, etc. or
>only
>the highest value found?
>
>2. Are your inputs all either 1 or 1 (as shown in your example) with no
>other values possible?
>
>3. Do you need to know the position in the sequence M where the highest
>value of Ax occurs?
>
>4. What is most important in this calculation? Speed? Size of RAM? Size of
>code?
>
>5. What language do you want to implement it in? On a PIC? on a PC?
>
>Bob Ammerman
>RAm Systems
>
>
>{Original Message removed}
2002\04\29@214911
by
ali dawji

dear Sir,
Thank you for your replay,
you are correct sir, this crosscorrelation computation between two digital
sequences,
1The 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).
2The 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.
4the 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}>From: Bob Ammerman <
.....rammermanKILLspam.....ADELPHIA.NET>
>ReplyTo: pic microcontroller discussion list <
EraseMEPICLISTspam_OUTTakeThisOuTMITVMA.MIT.EDU>
>To:
PICLISTspam_OUTMITVMA.MIT.EDU
>Subject: Re: M and S sequences
>Date: Mon, 29 Apr 2002 07:15:23 0400
>
>This looks like some sort of correlation computation.
>
>A couple of questions:
>
>1. Do you need to keep the individual values of A0, A1, A2, A3, etc. or
>only
>the highest value found?
>
>2. Are your inputs all either 1 or 1 (as shown in your example) with no
>other values possible?
>
>3. Do you need to know the position in the sequence M where the highest
>value of Ax occurs?
>
>4. What is most important in this calculation? Speed? Size of RAM? Size of
>code?
>
>5. What language do you want to implement it in? On a PIC? on a PC?
>
>Bob Ammerman
>RAm Systems
>
>
>{Original Message removed}
2002\04\29@223659
by
Bob Ammerman

The solution outlined below is appropriate for a PCbased 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
// 9bit 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 9bit 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 Mstream 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
Bob Ammerman <@spam@PICLISTKILLspammitvma.mit.edu> wrote:
> The solution outlined below is appropriate for a PCbased 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  KILLspamaiwKILLspamcypress.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 RemoveMElistservTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body
2002\04\30@190722
by
Bob Ammerman
More... (looser matching)
 Last day of these posts
 In 2002
, 2003 only
 Today
 New search...