再実装することになったのでここに残しておく。
メモ:
waveletは、平均値と差分のペアになっていて可逆である。
Class MainWindow Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs) '--- Haar wavelet変換 --- Dim A = CInt(tbA.Text) Dim B = CInt(tbB.Text) Dim C = CInt(tbC.Text) Dim D = CInt(tbD.Text) Dim AB0 = A + B Dim AB1 = A - B Dim CD0 = C + D Dim CD1 = C - D Dim HH = (AB0 + CD0) / 4 Dim LH = (AB0 - CD0) / 2 Dim HL = (AB1 + CD1) / 2 Dim LL = (AB1 - CD1) '--- Haar wavelet逆変換 --- Dim _HH = HH Dim _LH = LH / 2 Dim _HL = HL / 2 Dim _LL = LL / 4 Dim _00 = (_HH + _LL) Dim _01 = (_HH - _LL) Dim _10 = (_LH + _HL) Dim _11 = (_LH - _HL) Dim _A = _00 + _10 Dim _B = _01 + _11 Dim _C = _01 - _11 Dim _D = _00 - _10 End Sub End Class