如何计算 QR 码纠错的指数值

发布于 2024-12-12 05:42:16 字数 325 浏览 0 评论 0原文

当我开始阅读有关 Qr 代码的每篇文章时,我都可以看到 αx 表的一个 QR 代码指数,其中包含 αx 的特定幂的值。我不确定这个表是如何创建的。谁能给我解释一下这张表背后的逻辑。

作为参考,该表可在 http://www.matchadesign.com 找到/_blog/Matcha_Design_Blog/post/QR_Code_Demystified_-_Part_4/#

When i started reading about Qr Codes every article browsed i can see one QR Code Exponents of αx Table which having values for the specific powers of αx . I am not sure how this table is getting created. Can anybody explain me the logic behind this table.

For reference the table can be found at http://www.matchadesign.com/_blog/Matcha_Design_Blog/post/QR_Code_Demystified_-_Part_4/#

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

客…行舟 2024-12-19 05:42:16

zxing 源代码 可能会对您有所帮助。)

解释这里的所有数学知识需要花费很多时间。对于里德-所罗门纠错,您需要一个包含 256 个元素的伽罗瓦域(没什么花哨的——只是一组具有加法和求幂等定义的 256 个元素。)

这不是用数字来定义的,而是用系数全为 0 或 1 的多项式。我们使用具有 8 个系数的多项式——方便地将它们映射到 8 位值。虽然人们很容易将这些值视为数字,但它们实际上是不同的。

事实上,为了使加法等有意义,使所有运算都返回到伽罗瓦域中的值,所有结果都以该域中的不可约多项式为模进行计算。 (现在跳过这意味着什么。)

为了使运算更快,它有助于预先计算现场多项式“x”的幂。这是阿尔法。您可以将其视为“2”,因为多项式“x”是 00000010,尽管这并不完全准确。

那么你只需计算域中 x 的幂即可。因为它是一个领域,所以你会以这种方式触及该领域的每个元素。该序列似乎是 2 的幂,它恰好映射到它一段时间,直到本原多项式的第一个“模”生效。乘以 x 确实仍然类似于乘以 2,但在这个领域确实有点巧合。

(The zxing source code for this might help you.)

It would take a lot to explain all the math here. For the Reed-Solomon error correction, you need a Galois field of 256 elements (nothing fancy -- just a set of 256 things that have addition and exponentiation and such defined.)

This is defined not in terms of numbers, but in terms of polynomials whose coefficients are all 0 or 1. We work with polynomials with 8 coefficient -- conveniently these map to 8-bit values. While it's tempting to think of those values as numbers, they're really something different.

In fact for addition and such to make sense such that all the operations land you back in a value in the Galois field, all the results are computed modulo an irreducible polynomial in the field. (Skip what that means now.)

To make operations faster, it helps to pre-compute what the powers of the polynomial "x" are in the field. This is alpha. You can think of this as "2", since the polynomial "x" is 00000010, though that's not entirely accurate.

So then you just compute the powers of x in the field. Because it's a field you'll hit every element of the field this way. The sequence seems to be the powers of two, which it happens to map to for a short while, until the first "modulo" of the primitive polynomial takes effect. Multiplying by x is indeed still something like multiplying by 2 but it's a bit of coincidence in this field, really.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文