mirror of
https://github.com/hb9fxq/gr-digitalhf
synced 2024-12-22 07:09:59 +00:00
fixed for python3
This commit is contained in:
parent
5a5c738144
commit
2192527212
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
from digitalhf.digitalhf_swig import viterbi27
|
from digitalhf.digitalhf_swig import viterbi27
|
||||||
|
|
||||||
## ---- constellatios -----------------------------------------------------------
|
## ---- constellatios -----------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4])), common.CONST_DTYPE)
|
||||||
|
|
||||||
## ---- constellation indices ---------------------------------------------------
|
## ---- constellation indices ---------------------------------------------------
|
||||||
MODE_BPSK=0
|
MODE_BPSK=0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
from digitalhf.digitalhf_swig import viterbi27
|
from digitalhf.digitalhf_swig import viterbi27
|
||||||
|
|
||||||
## ---- Walsh-8 codes -----------------------------------------------------------
|
## ---- Walsh-8 codes -----------------------------------------------------------
|
||||||
|
@ -76,9 +76,9 @@ class ScrambleData(object):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
## ---- constellatios -----------------------------------------------------------
|
## ---- constellatios -----------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4])), common.CONST_DTYPE)
|
||||||
|
|
||||||
## ---- constellation indices ---------------------------------------------------
|
## ---- constellation indices ---------------------------------------------------
|
||||||
MODE_BPSK=0
|
MODE_BPSK=0
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
from digitalhf.digitalhf_swig import viterbi27
|
from digitalhf.digitalhf_swig import viterbi27
|
||||||
|
|
||||||
## ---- constellations -----------------------------------------------------------
|
## ---- constellations -----------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [1,0,2,3,7,6,4,5]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [1,0,2,3,7,6,4,5])), common.CONST_DTYPE)
|
||||||
QAM16=np.array(
|
QAM16=np.array(
|
||||||
zip([+0.866025+0.500000j, 0.500000+0.866025j, 1.000000+0.000000j, 0.258819+0.258819j,
|
list(zip([+0.866025+0.500000j, 0.500000+0.866025j, 1.000000+0.000000j, 0.258819+0.258819j,
|
||||||
-0.500000+0.866025j, 0.000000+1.000000j, -0.866025+0.500000j, -0.258819+0.258819j,
|
-0.500000+0.866025j, 0.000000+1.000000j, -0.866025+0.500000j, -0.258819+0.258819j,
|
||||||
+0.500000-0.866025j, 0.000000-1.000000j, 0.866025-0.500000j, 0.258819-0.258819j,
|
+0.500000-0.866025j, 0.000000-1.000000j, 0.866025-0.500000j, 0.258819-0.258819j,
|
||||||
-0.866025-0.500000j, -0.500000-0.866025j, -1.000000+0.000000j, -0.258819-0.258819j],
|
-0.866025-0.500000j, -0.500000-0.866025j, -1.000000+0.000000j, -0.258819-0.258819j],
|
||||||
range(16)), common.CONST_DTYPE)
|
range(16))), common.CONST_DTYPE)
|
||||||
QAM32=np.array(
|
QAM32=np.array(
|
||||||
zip([+0.866380+0.499386j, 0.984849+0.173415j, 0.499386+0.866380j, 0.173415+0.984849j,
|
list(zip([+0.866380+0.499386j, 0.984849+0.173415j, 0.499386+0.866380j, 0.173415+0.984849j,
|
||||||
+0.520246+0.520246j, 0.520246+0.173415j, 0.173415+0.520246j, 0.173415+0.173415j,
|
+0.520246+0.520246j, 0.520246+0.173415j, 0.173415+0.520246j, 0.173415+0.173415j,
|
||||||
-0.866380+0.499386j, -0.984849+0.173415j, -0.499386+0.866380j, -0.173415+0.984849j,
|
-0.866380+0.499386j, -0.984849+0.173415j, -0.499386+0.866380j, -0.173415+0.984849j,
|
||||||
-0.520246+0.520246j, -0.520246+0.173415j, -0.173415+0.520246j, -0.173415+0.173415j,
|
-0.520246+0.520246j, -0.520246+0.173415j, -0.173415+0.520246j, -0.173415+0.173415j,
|
||||||
|
@ -24,9 +24,9 @@ QAM32=np.array(
|
||||||
+0.520246-0.520246j, 0.520246-0.173415j, 0.173415-0.520246j, 0.173415-0.173415j,
|
+0.520246-0.520246j, 0.520246-0.173415j, 0.173415-0.520246j, 0.173415-0.173415j,
|
||||||
-0.866380-0.499386j, -0.984849-0.173415j, -0.499386-0.866380j, -0.173415-0.984849j,
|
-0.866380-0.499386j, -0.984849-0.173415j, -0.499386-0.866380j, -0.173415-0.984849j,
|
||||||
-0.520246-0.520246j, -0.520246-0.173415j, -0.173415-0.520246j, -0.173415-0.173415j],
|
-0.520246-0.520246j, -0.520246-0.173415j, -0.173415-0.520246j, -0.173415-0.173415j],
|
||||||
range(32)), common.CONST_DTYPE)
|
range(32))), common.CONST_DTYPE)
|
||||||
QAM64=np.array(
|
QAM64=np.array(
|
||||||
zip([+1.000000+0.000000j, 0.822878+0.568218j, 0.821137+0.152996j, 0.932897+0.360142j,
|
list(zip([+1.000000+0.000000j, 0.822878+0.568218j, 0.821137+0.152996j, 0.932897+0.360142j,
|
||||||
+0.000000-1.000000j, 0.822878-0.568218j, 0.821137-0.152996j, 0.932897-0.360142j,
|
+0.000000-1.000000j, 0.822878-0.568218j, 0.821137-0.152996j, 0.932897-0.360142j,
|
||||||
+0.568218+0.822878j, 0.588429+0.588429j, 0.588429+0.117686j, 0.588429+0.353057j,
|
+0.568218+0.822878j, 0.588429+0.588429j, 0.588429+0.117686j, 0.588429+0.353057j,
|
||||||
+0.568218-0.822878j, 0.588429-0.588429j, 0.588429-0.117686j, 0.588429-0.353057j,
|
+0.568218-0.822878j, 0.588429-0.588429j, 0.588429-0.117686j, 0.588429-0.353057j,
|
||||||
|
@ -42,7 +42,7 @@ QAM64=np.array(
|
||||||
-0.152996-0.821137j, -0.117686-0.588429j, -0.117686-0.117686j, -0.117686-0.353057j,
|
-0.152996-0.821137j, -0.117686-0.588429j, -0.117686-0.117686j, -0.117686-0.353057j,
|
||||||
-0.360142+0.932897j, -0.353057+0.588429j, -0.353057+0.117686j, -0.353057+0.353057j,
|
-0.360142+0.932897j, -0.353057+0.588429j, -0.353057+0.117686j, -0.353057+0.353057j,
|
||||||
-0.360142-0.932897j, -0.353057-0.588429j, -0.353057-0.117686j, -0.353057-0.353057j],
|
-0.360142-0.932897j, -0.353057-0.588429j, -0.353057-0.117686j, -0.353057-0.353057j],
|
||||||
range(64)), common.CONST_DTYPE)
|
range(64))), common.CONST_DTYPE)
|
||||||
|
|
||||||
## for test
|
## for test
|
||||||
QAM64p = QAM64[(3,24,56,35,39,60,28,7),]
|
QAM64p = QAM64[(3,24,56,35,39,60,28,7),]
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
from digitalhf.digitalhf_swig import viterbi27, viterbi29
|
from digitalhf.digitalhf_swig import viterbi27, viterbi29
|
||||||
|
|
||||||
## ---- constellations ---------------------------------------------------------
|
## ---- constellations ---------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [1,0,2,3,7,6,4,5]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [1,0,2,3,7,6,4,5])), common.CONST_DTYPE)
|
||||||
QAM16=np.array(
|
QAM16=np.array(
|
||||||
zip([+0.866025+0.500000j, +0.500000+0.866025j, +1.000000+0.000000j, +0.258819+0.258819j,
|
list(zip([+0.866025+0.500000j, +0.500000+0.866025j, +1.000000+0.000000j, +0.258819+0.258819j,
|
||||||
-0.500000+0.866025j, +0.000000+1.000000j, -0.866025+0.500000j, -0.258819+0.258819j,
|
-0.500000+0.866025j, +0.000000+1.000000j, -0.866025+0.500000j, -0.258819+0.258819j,
|
||||||
+0.500000-0.866025j, +0.000000-1.000000j, +0.866025-0.500000j, +0.258819-0.258819j,
|
+0.500000-0.866025j, +0.000000-1.000000j, +0.866025-0.500000j, +0.258819-0.258819j,
|
||||||
-0.866025-0.500000j, -0.500000-0.866025j, -1.000000+0.000000j, -0.258819-0.258819j],
|
-0.866025-0.500000j, -0.500000-0.866025j, -1.000000+0.000000j, -0.258819-0.258819j],
|
||||||
range(16)), common.CONST_DTYPE)
|
range(16))), common.CONST_DTYPE)
|
||||||
QAM32=np.array(
|
QAM32=np.array(
|
||||||
zip([+0.866380+0.499386j, +0.984849+0.173415j, +0.499386+0.866380j, +0.173415+0.984849j,
|
list(zip([+0.866380+0.499386j, +0.984849+0.173415j, +0.499386+0.866380j, +0.173415+0.984849j,
|
||||||
+0.520246+0.520246j, +0.520246+0.173415j, +0.173415+0.520246j, +0.173415+0.173415j,
|
+0.520246+0.520246j, +0.520246+0.173415j, +0.173415+0.520246j, +0.173415+0.173415j,
|
||||||
-0.866380+0.499386j, -0.984849+0.173415j, -0.499386+0.866380j, -0.173415+0.984849j,
|
-0.866380+0.499386j, -0.984849+0.173415j, -0.499386+0.866380j, -0.173415+0.984849j,
|
||||||
-0.520246+0.520246j, -0.520246+0.173415j, -0.173415+0.520246j, -0.173415+0.173415j,
|
-0.520246+0.520246j, -0.520246+0.173415j, -0.173415+0.520246j, -0.173415+0.173415j,
|
||||||
|
@ -24,9 +24,9 @@ QAM32=np.array(
|
||||||
+0.520246-0.520246j, +0.520246-0.173415j, +0.173415-0.520246j, +0.173415-0.173415j,
|
+0.520246-0.520246j, +0.520246-0.173415j, +0.173415-0.520246j, +0.173415-0.173415j,
|
||||||
-0.866380-0.499386j, -0.984849-0.173415j, -0.499386-0.866380j, -0.173415-0.984849j,
|
-0.866380-0.499386j, -0.984849-0.173415j, -0.499386-0.866380j, -0.173415-0.984849j,
|
||||||
-0.520246-0.520246j, -0.520246-0.173415j, -0.173415-0.520246j, -0.173415-0.173415j],
|
-0.520246-0.520246j, -0.520246-0.173415j, -0.173415-0.520246j, -0.173415-0.173415j],
|
||||||
range(32)), common.CONST_DTYPE)
|
range(32))), common.CONST_DTYPE)
|
||||||
QAM64=np.array(
|
QAM64=np.array(
|
||||||
zip([+1.000000+0.000000j, 0.822878+0.568218j, 0.821137+0.152996j, 0.932897+0.360142j,
|
list(zip([+1.000000+0.000000j, 0.822878+0.568218j, 0.821137+0.152996j, 0.932897+0.360142j,
|
||||||
+0.000000-1.000000j, 0.822878-0.568218j, 0.821137-0.152996j, 0.932897-0.360142j,
|
+0.000000-1.000000j, 0.822878-0.568218j, 0.821137-0.152996j, 0.932897-0.360142j,
|
||||||
+0.568218+0.822878j, 0.588429+0.588429j, 0.588429+0.117686j, 0.588429+0.353057j,
|
+0.568218+0.822878j, 0.588429+0.588429j, 0.588429+0.117686j, 0.588429+0.353057j,
|
||||||
+0.568218-0.822878j, 0.588429-0.588429j, 0.588429-0.117686j, 0.588429-0.353057j,
|
+0.568218-0.822878j, 0.588429-0.588429j, 0.588429-0.117686j, 0.588429-0.353057j,
|
||||||
|
@ -42,9 +42,9 @@ QAM64=np.array(
|
||||||
-0.152996-0.821137j, -0.117686-0.588429j, -0.117686-0.117686j, -0.117686-0.353057j,
|
-0.152996-0.821137j, -0.117686-0.588429j, -0.117686-0.117686j, -0.117686-0.353057j,
|
||||||
-0.360142+0.932897j, -0.353057+0.588429j, -0.353057+0.117686j, -0.353057+0.353057j,
|
-0.360142+0.932897j, -0.353057+0.588429j, -0.353057+0.117686j, -0.353057+0.353057j,
|
||||||
-0.360142-0.932897j, -0.353057-0.588429j, -0.353057-0.117686j, -0.353057-0.353057j],
|
-0.360142-0.932897j, -0.353057-0.588429j, -0.353057-0.117686j, -0.353057-0.353057j],
|
||||||
range(64)), common.CONST_DTYPE)
|
range(64))), common.CONST_DTYPE)
|
||||||
QAM256=np.array(
|
QAM256=np.array(
|
||||||
zip([+0.959366+0.056433j, +0.959366+0.169300j, +0.846499+0.507899j, +0.959366+0.282166j,
|
list(zip([+0.959366+0.056433j, +0.959366+0.169300j, +0.846499+0.507899j, +0.959366+0.282166j,
|
||||||
+0.846499+0.056433j, +0.846499+0.169300j, +0.846499+0.395033j, +0.846499+0.282166j,
|
+0.846499+0.056433j, +0.846499+0.169300j, +0.846499+0.395033j, +0.846499+0.282166j,
|
||||||
+0.959366-0.056433j, +0.959366-0.169300j, +0.846499-0.507899j, +0.959366-0.282166j,
|
+0.959366-0.056433j, +0.959366-0.169300j, +0.846499-0.507899j, +0.959366-0.282166j,
|
||||||
+0.846499-0.056433j, +0.846499-0.169300j, +0.846499-0.395033j, +0.846499-0.282166j,
|
+0.846499-0.056433j, +0.846499-0.169300j, +0.846499-0.395033j, +0.846499-0.282166j,
|
||||||
|
@ -111,7 +111,7 @@ QAM256=np.array(
|
||||||
-0.282166+0.056433j, -0.282166+0.169300j, -0.282166+0.395033j, -0.282166+0.282166j,
|
-0.282166+0.056433j, -0.282166+0.169300j, -0.282166+0.395033j, -0.282166+0.282166j,
|
||||||
-0.282166-0.846499j, -0.282166-0.733632j, -0.282166-0.507899j, -0.282166-0.620766j,
|
-0.282166-0.846499j, -0.282166-0.733632j, -0.282166-0.507899j, -0.282166-0.620766j,
|
||||||
-0.282166-0.056433j, -0.282166-0.169300j, -0.282166-0.395033j, -0.282166-0.282166j],
|
-0.282166-0.056433j, -0.282166-0.169300j, -0.282166-0.395033j, -0.282166-0.282166j],
|
||||||
range(256)), common.CONST_DTYPE)
|
range(256))), common.CONST_DTYPE)
|
||||||
|
|
||||||
## ---- constellation indices ---------------------------------------------------
|
## ---- constellation indices ---------------------------------------------------
|
||||||
MODE_WALSH = 0
|
MODE_WALSH = 0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import common
|
from . import common
|
||||||
from digitalhf.digitalhf_swig import viterbi27
|
from digitalhf.digitalhf_swig import viterbi27
|
||||||
|
|
||||||
class Deinterleaver(object):
|
class Deinterleaver(object):
|
||||||
|
@ -27,9 +27,9 @@ class Deinterleaver(object):
|
||||||
|
|
||||||
|
|
||||||
## ---- constellatios -----------------------------------------------------------
|
## ---- constellatios -----------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4])), common.CONST_DTYPE)
|
||||||
|
|
||||||
## ---- constellation indices ---------------------------------------------------
|
## ---- constellation indices ---------------------------------------------------
|
||||||
MODE_BPSK=0
|
MODE_BPSK=0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
|
|
||||||
PREAMBLE = common.n_psk(8, np.array([ 2,6,4,4,6,4,6,2,6,0 # 1
|
PREAMBLE = common.n_psk(8, np.array([ 2,6,4,4,6,4,6,2,6,0 # 1
|
||||||
,2,2,0,4,6,2,2,0,2,6 # 2
|
,2,2,0,4,6,2,2,0,2,6 # 2
|
||||||
|
@ -27,9 +27,9 @@ PREAMBLE = common.n_psk(8, np.array([ 2,6,4,4,6,4,6,2,6,0 # 1
|
||||||
,2,2,4])) ## 203 symbols
|
,2,2,4])) ## 203 symbols
|
||||||
|
|
||||||
## ---- constellatios -----------------------------------------------------------
|
## ---- constellatios -----------------------------------------------------------
|
||||||
BPSK=np.array(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1]), common.CONST_DTYPE)
|
BPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(2)/2), [0,1])), common.CONST_DTYPE)
|
||||||
QPSK=np.array(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2]), common.CONST_DTYPE)
|
QPSK=np.array(list(zip(np.exp(2j*np.pi*np.arange(4)/4), [0,1,3,2])), common.CONST_DTYPE)
|
||||||
PSK8=np.array(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4]), common.CONST_DTYPE)
|
PSK8=np.array(list(zip(np.exp(2j*np.pi*np.arange(8)/8), [0,1,3,2,6,7,5,4])), common.CONST_DTYPE)
|
||||||
|
|
||||||
## ---- constellation indices ---------------------------------------------------
|
## ---- constellation indices ---------------------------------------------------
|
||||||
MODE_BPSK=0
|
MODE_BPSK=0
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import common
|
from . import common
|
||||||
|
|
||||||
from digitalhf.digitalhf_swig import viterbi27
|
from digitalhf.digitalhf_swig import viterbi27
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue