gfdeconv not the same as LFSR?
2 views (last 30 days)
Show older comments
I have been trying to implement the following formula in matlab:
b84x84+...+b1x+b0 = Rf(x)g(x)[ bn-1xn-1+...+b85x85 ] + g(x)
Where the result is an 85 bit (84 downto 0) vector of "check bits", the part in brackets on the right [ bn-1xn-1+...+b85x85 ] is the data we are sending.
I believe: Rf(x)g(x)[ bn-1xn-1+...+b85x85 ] is forming a CRC where f(x)g(x) is the CRC polynomial.
What I think the formula is saying is to find the remainder of the data divided by f(x)g(x) and then add g(x). This is all using finite field GF(2).
To do this I was performing the following:
FxGx = gfconv(fs_x,gs_x);
[q, R] = gfdeconv(data,FxGx); % so R is our CRC I think
check_bits = gfadd(R,gs_x);
This would then give me my 85 check bits to append to the data prior to transmission. However, the result wasn't correct.
I replaced the [q, R] = gfdeconv(data,FxGx) line with my own LFSR using FxGx as the feedback terms for the LFSR and now I get the expected result.
I was under the impression that gfdeconv was effectively doing the LFSR for me, but I guess it's doing something slightly different. So my question is, is gfdeconv not the same as LFSR?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!