From: David B. <Dav...@mo...> - 2004-07-06 15:40:37
|
Quentin, The reason for the reversal is a stupidity in matlab. I can't remember the details offhand but I believe hammgen and cyclgen return the matrices in reverse order. Similarly the polynomials with cyclpoly are reversed... I tried to keep the functions consistent with each other, so that they might be used interchangably. Regards David According to Quentin Spencer <qsp...@ie...> (on 07/06/04): > I just returned from vacation and noticed that CVS contained several > updates to the files in question in my previous mail below. I'm happy to > report that cyclgen appears to work properly for the inputs that I > tested. I also tested cyclpoly and discovered that when compared to the > ouput of the same function in Matlab, the results are the same but > appear in reverse order, i.e. fliplr(cyclgen(255,247)) is equivalent to > cyclgen(255,247) in Matlab. Thank you for all the work you have done in > fixing these functions. > > -Quentin > > > > Quentin Spencer wrote: > > >OK, I tested your changes to the coding stuff and this is what I found: > > > >bchpoly appears to give correct results for the cases I tested > >cyclgen(255,bchpoly(255,247)) gives the correct result > >cyclgen(255,bchpoly(255,239)) gives a matrix that is correct in the > >first 8x8 submatrix, and zeros everywhere else !? > >cyclpoly gives a vector containing all zeros for every input I tried. > > > >Well, I guess there's at least some progress since one case worked. I'm > >sorry the news isn't better. > > > >-Quentin > > > > > >David Bateman wrote: > > > >>According to Quentin Spencer <qsp...@ie...> (on 06/16/04): > >> > >>>David, > >>> > >>>Thanks. The updates fixed hammgen. However, now I've found another > >>>bug. I don't know if it was there all along or newly introduced. The > >>>following command should produce the 16x255 parity check matrix for > >>>a BCH 2-error correcting code: > >>>cyclgen(255,bchpoly(255,239)) > >>> > >>>The result instead is: > >>>error: cyclgen: generator polynomial does not produce cyclic code > >>> > >>>I verified the resulting polynomial against MATLAB and they matched. > >> > >>Ok, I'm a bit draft. The test I added checks if the polynomial is > >>primitive > >>rather than just irreducible. I'd previously tried to adapt this test in > >>the older code, but failed. > >> > >>So I went back to the basic implementation of dividing x^n-1 by the > >>polynomial and checking that there was no remainder. It appears to > >>work correctly for you test case now. Though maybe you want to give > >>it a bit more testing.. Changes checked into the CVS > >> > >>Regards > >>David > > -- David Bateman Dav...@mo... Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary |