deconv function and gf arithmetic not working?
6 views (last 30 days)
Show older comments
I came across this strange behaviour that seems to be a bug, but I am not sure that is the case.
>>poly = [1 1 0 0 0 1 0 1];
>>polyGF = gf(poly, 1);
>> z = gf([1, zeros(1, 607)], 1);
>>[a, b] = deconv(z, polyGF);
According the Galois Field (gf) documentation deconv must perform polynomial division, where the polynomial coefficients are interpreted in descending order. The problem is that according to this code b will be all 0s, which is wrong. In fact, if I do conv(a, polyGF) it wont result in z.
I did write my own polynomial division in matlab just using arrays of gf, and I get what I expet. Worse, I did translate the code to python using the galois package and its builtin functions, and I get the result I expect.
I am thorn between beleiving it is a bug or just a limitation of the size of the arrays that deconv can support, despite I can not find any related information on the documentation.
Last but not least, if I reduce the size z, let us say making it z = gf([1, zeros(1, 120)]), I get a correct answer, which leads me to think it is either a deconv internal limitation of sizes or bug.
version: R2018b
1 Comment
prabhat kumar sharma
on 2 May 2024
I have also faced the same behaviour, On the smaller sized GF arrays I am getting the correct results while on large values getting unexpected results. It suspects it's related to the size limitation mostly.
Answers (0)
See Also
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!