help-octave
[Top][All Lists]

## Re: Division and remainder of F2m polynomials

 From: Doug Stewart Subject: Re: Division and remainder of F2m polynomials Date: Fri, 11 Jan 2019 13:24:25 -0500

On Fri, Jan 11, 2019 at 1:10 PM Jeffrey Walton <address@hidden> wrote:
Hi Everyone,

I have a product in F2m and I need to reduce it via a primitive
polynomial. As an example p={15,1} (from HP's low-weight primitive
polynomials [1]). Then:

# 0xF693C693
>> a = gf( [1 1 1 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1]);
# 0x8003
>> p = gf( [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]);

gfdeconv(), mod() and rem() appear to return errors.

How do I get the remainder from the operation?

does this help?

a = ( [1 1 1 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1]);
p = ( [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]);

b=deconv(a,p)

b =

1   1   1   1   0   1   1   0   1   0   0   1   0   0   0  -1  -1

==========

>> r = rem(a, p);
error: rem: nonconformant arguments (op1 is 1x34, op2 is 1x15)
>> r = mod(a, p);
error: mod: nonconformant arguments (op1 is 1x34, op2 is 1x15)

>> [q,r] = gfdeconv(a, p);
warning: the 'gfdeconv' function belongs to the communications package from
Octave Forge but has not yet been implemented.

contribute missing functionality.
error: 'gfdeconv' undefined near line 1 column 8

(I'd love to help with gfdeconv, but I'm not sure of my own work at the moment).

=====

Here are the pages I am working from:

* https://www.mathworks.com/help/matlab/ref/rem.html
* https://www.mathworks.com/help/matlab/ref/mod.html
* https://www.mathworks.com/help/comm/ref/gfdeconv.html

* [1] http://www.hpl.hp.com/techreports/98/HPL-98-135.pdf

--
DAS