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 ----- From: "ali dawji" To: Sent: Monday, April 29, 2002 5:14 AM Subject: M and S sequences > Dear Sir > I have a question and I hope if you can answer me. > > I have tow one dimensional sequence or matrix., > The first sequence is called M with length 511 number: > M[511]={ 1, 1, 1, 1, 1, 1, 1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1?????..}; > And the second sequence is called with nine numbers > S [9] = {1, 1, 1,-1,-1, 1,-1,-1,-1}; > > I want to > 1- Multiplied the sequences S with first ninth number of the sequence M, and > keep the result as A0, > 2- The multiplication procedure as flows > The first number of M * the first number of S, if the answer is negative => > (-1), and if the answer is positive => 1 > Example: > M= {1, 1, 1, 1, 1, 1, 1,-1,-1}; /*(first ninth number of M sequence)*/ > S= {1, 1, 1,-1,-1, 1,-1,-1,-1}; > 1*1=1 > 1*1=1 > 1*1=1 > 1*-1=-1 > 1*-1=-1 > 1*1=1 > 1*-1=-1 > -1*-1=1 > -1*-1=1 > The answer is 3= (6*1- (3*-1)) > 3-shift the sequence M on number to the right and multiplied the sequence S > by the M sequence (from number 2-10). And keep the multiplication result in > A1, > repeat the procedure of the multiplication till the end of the sequence M. > 4- Calculate the maximum value multiplication result A0, A1, A2? > > > sorry since my language is not so good > thank you > > > > _________________________________________________________________ > Join the world s largest e-mail service with MSN Hotmail. > http://www.hotmail.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.