我已经阅读了精彩的PSK解调教程:https://wiki.gnuradio.org/index.php/Guided_Tutorial_PSK_Demodulation
我已经创建了一个非常简单的DBPSK调制器

我输入了一系列滑动的比特。所以我输入的第一个字节是0x01,下一个字节是0x02,0x04,0x08,依此类推。这是hd的输出:
00000000 00 00 ac 0e d0 f0 20 40 81 02 04 08 10 00 20 40 |...... @...... @|
00000010 81 02 04 08 10 00 20 40 81 02 04 08 10 00 20 40 |...... @...... @|
*
00015000最初的几个字节是垃圾,但随后您可以看到模式。查看第二行: 0x81、0x02、0x04、0x08、0x10、0x00、0x20、0x40、0x81
行走的位在那里,但在0x10之后,PSK解调器接收0x00,几个字节后接收0x81。几乎看起来时间恢复是关闭的。
还有没有人见过这样的东西?
发布于 2018-03-06 10:10:12
好了,我想通了。下面是我的DBPSK调制。

如果让它运行,误码率将继续下降。有些事情要牢记在心。PSK Mod接受一个8位的值(或者也可能是一个短整型或整型)。它抓取比特并对其进行调制。那么PSK解码器也会做同样的事情。如果你将它保存到一个文件中,你将不会得到精确的比特。您将需要移动这些位以对齐它们。我添加了Vector插入块来生成某种类型的前同步码。
然后我写了一些Python来找到我的前言:
import numpy as np
import matplotlib.pyplot as plt
def findPreamble(preamble, x):
for i in range(0, len(x) - len(preamble)):
check = 0
for j in range(0, len(preamble)):
check += x[i + j] - preamble[j]
if (check == 0):
print("Found a preamble at {0}".format(i))
x = x[i + len(preamble)::]
break
return check == 0, x
def shiftBits(x):
for i in range (0, len(x) - 1):
a = x[i]
a = a << 1
if x[i + 1] & 0x80:
a = a | 1
x[i] = (a & 0xFF)
return x
f = open('test.bits', 'rb')
x = f.read();
f.close()
preamble = [0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]
searchForBit = True
x = np.frombuffer(x, dtype='uint8')
x = x.astype('int')
print(x)
while searchForBit:
x = shiftBits(x)
print(x)
found, y = findPreamble(preamble, x)
if found:
searchForBit = False
y = y.astype('uint8')
f = open('test.bits', 'wb')
f.write(y)
f.close()https://stackoverflow.com/questions/49096523
复制相似问题