展开角度以具有连续相位 [英] Unwrap angle to have continuous phase
本文介绍了展开角度以具有连续相位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一系列与此类似的阶段:
Let's say I have an array of phases similar to this:
import numpy as np
import matplotlib.pyplot as plt
phase = np.linspace(0., 100., 1000) % np.pi
plt.plot(phase)
plt.show()
(有很多这样的间断点)
(with many discontinuities like this)
如何从中获取更多连续"阶段的数组?
当然,我已经尝试使用 np.unwrap
:
Of course, I already tried with np.unwrap
:
plt.plot(np.unwrap(phase))
或
plt.plot(np.unwrap(phase),discont=0.1)
但它仍然完全相似:
我期望的是这样的展开:
What I expected was an unwrapping like this:
推荐答案
如果要使原始相位保持pi周期性,则应先将其翻倍,拆开包装,然后将其除以二:
If you want to keep your original phase with pi-periodicity, you should first double it, unwrap it, then divide it by two:
plt.plot(np.unwrap(2 * phase) / 2)
plt.plot(np.unwrap(2 * phase) / 2)
这篇关于展开角度以具有连续相位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文