如何解码Reed-Solomon算法? [英] How Do I Decode Reed- Solomon Algorithm?
本文介绍了如何解码Reed-Solomon算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是reed Solomon的编码,但是我想要解码哪个与下面的代码完全相反。我怎么能得到这个。谁能帮我?提前谢谢
This is encoding of reed Solomon but i want to decode which is totally reverse of following code. How can i get this. Can anyone help me? Thank you in advance
Module Module1
Dim i As Integer
Dim j As Integer
Dim k As Integer = Console.ReadLine()
Dim m As Integer = Console.ReadLine()
Dim d(10) As Integer
Dim c(20) As Integer
Dim t As Integer = 0
Dim a() As Integer = {228, 48, 15, 111, 62}
Dim b As Integer
Dim result As Integer
Public Function Mult(ByVal t As Integer, ByVal tempa As Integer) As Integer
Dim Log(255) As Integer
Dim Alog(255) As Integer
' Dim a As Integer
Dim b As Integer = t
Log(0) = -255
Alog(0) = 1
For i As Integer = 1 To 255
Alog(i) = Alog(i - 1) * 2
If (Alog(i) >= 256) Then Alog(i) = Alog(i) Xor 301
Log(Alog(i)) = i
Next
result = Alog((Log(tempa) + Log(b)) Mod 255)
Return result
End Function
Sub Main()
For i As Integer = 0 To m - 1
d(i) = Console.ReadLine()
Next i
For i As Integer = 1 To 10
c(i) = 0
Next i
For i As Integer = 0 To m - 1
t = (d(i) Xor c(k - 1))
For j As Integer = k - 1 To 0 Step -1
If t = 0 Then
c(j) = 0
Else
c(j) = Mult(t, a(j))
End If
If j > 0 Then c(j) = c(j - 1) Xor c(j)
Next
Next
For i As Integer = 0 To k - 1
Console.WriteLine(c(i))
Next
End Sub
End Module
推荐答案
请参阅我的评论问题。
当您说以下代码时,您会显示程序代码(实现Re的一部分) ed-Solomon算法与否:-));没有逆转它的概念。此代码与纠错码不同,后者是算法使用的一些数据。问题根本没有意义。
请参阅:
http://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction [ ^ ],
http://en.wikipedia.org/wiki/Error-correcting_code [ ^ ]。
-SA
Please see my comment to the question.
When you say "following code", you show the program code (implementing part of the Reed-Solomon algorithm or not :-)); there is no such concept as "reversing" it. This code is not the same as "error correcting codes", which is some data the algorithm works with. The question simply makes no sense.
Please see:
http://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction[^],
http://en.wikipedia.org/wiki/Error-correcting_code[^].
—SA
>
这篇关于如何解码Reed-Solomon算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文