为了账号安全,请及时绑定邮箱和手机立即绑定

Python:FM Demod 实现

Python:FM Demod 实现

慕尼黑的夜晚无繁华 2022-07-26 17:07:23
我正在考虑分析一些特定值的时间序列,因为它是一个调频信号。我正在寻找 FM 解调器的 Python 实现。我知道 Matlab 和 Octave 中有解调器功能;对于 Python,我找到了这个FreqDemod包,但它似乎没有做我想做的事情。帮助将不胜感激。

1 回答

?
偶然的你

TA贡献1841条经验 获得超3个赞

这是一个对复杂样本进行 FM 解调的 Python 函数。


def fm_demod(x, df=1.0, fc=0.0):

    ''' Perform FM demodulation of complex carrier.


    Args:

        x (array):  FM modulated complex carrier.

        df (float): Normalized frequency deviation [Hz/V].

        fc (float): Normalized carrier frequency.


    Returns:

        Array of real modulating signal.

    '''


    # Remove carrier.

    n = sp.arange(len(x))

    rx = x*sp.exp(-1j*2*sp.pi*fc*n)


    # Extract phase of carrier.

    phi = sp.arctan2(sp.imag(rx), sp.real(rx))


    # Calculate frequency from phase.

    y = sp.diff(sp.unwrap(phi)/(2*sp.pi*df))


    return y


查看完整回答
反对 回复 2022-07-26
  • 1 回答
  • 0 关注
  • 197 浏览
慕课专栏
更多

添加回答

代码语言

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信