コード例 #1
0
ファイル: demodulate_rds.py プロジェクト: burghardt/Pydemod
xi = rdsBand[::2] * c57
xq = rdsBand[1::2] * (-c57)


# low-pass filter

filtLP = signal.remez(400, [0, 2400, 3000, sampleRate / 4], [1, 0], Hz=sampleRate / 2)

xfi = signal.convolve(xi, filtLP)
xfq = signal.convolve(xq, filtLP)


# shape filter

shapeFilt = shaping_filter.rrcosfilter(300, 1, 1 / (2 * 1187.5), sampleRate / 2)[1]

xsfi = signal.convolve(xfi, shapeFilt)
xsfq = signal.convolve(xfq, shapeFilt)


if len(xsfi) % 2 == 1:
    xsfi = xsfi[:-1]
    xsfq = xsfq[:-1]

# downsample

xdi = (xsfi[::2] + xsfi[1::2]) / 2
xdq = xsfq[::2]

コード例 #2
0
c57 = numpy.tile([1., -1.], len(rdsBand) / 4)

xi = rdsBand[::2] * c57
xq = rdsBand[1::2] * (-c57)

# low-pass filter

filtLP = signal.remez(400, [0, 2400, 3000, sampleRate / 4], [1, 0],
                      Hz=sampleRate / 2)

xfi = signal.convolve(xi, filtLP)
xfq = signal.convolve(xq, filtLP)

# shape filter

shapeFilt = shaping_filter.rrcosfilter(300, 1, 1 / (2 * 1187.5),
                                       sampleRate / 2)[1]

xsfi = signal.convolve(xfi, shapeFilt)
xsfq = signal.convolve(xfq, shapeFilt)

if len(xsfi) % 2 == 1:
    xsfi = xsfi[:-1]
    xsfq = xsfq[:-1]

# downsample

xdi = (xsfi[::2] + xsfi[1::2]) / 2
xdq = xsfq[::2]

# remove phase drift using a moving average
コード例 #3
0
ファイル: rds.py プロジェクト: zdiputs/Pydemod
def pulse_shaping_filter(length, sample_rate):
    return shaping.rrcosfilter(length, 1, 1 / (2 * 1187.5), sample_rate + 1)[1]
コード例 #4
0
ファイル: rds.py プロジェクト: ChristopheJacquet/Pydemod
def pulse_shaping_filter(length, sample_rate):
    return shaping.rrcosfilter(length, 1, 1/(2*1187.5), sample_rate+1) [1]