简体   繁体   English

使用 python 插值测量的正弦波

[英]Interpolating measured sine wave using python

I have 2 sampled sine waves obtained as a measurement from a DSO.我从 DSO 获得了 2 个采样正弦波作为测量值。 The sampling rate of the DSO is 160 GSa/s and my signal is 60 GHz. DSO 的采样率为 160 GSa/s,我的信号为 60 GHz。 I need to find the phase difference between the two sine waves.我需要找到两个正弦波之间的相位差。 Both are the same frequency.两者频率相同。 However, the sampling rate is not enough to accurately determine the phase.但是,采样率不足以准确确定相位。 Is there any way to interpolate the measured signal to get a better sine wave and then calculate the phase difference?有什么方法可以对测量的信号进行插值以获得更好的正弦波,然后计算相位差?

You may fit to sine functions , but for the phase difference ( delta phi=2pi frequency delta t ) it would be sufficient to detect and compare the zero-crossings (respective a possible constant offset), which may be found from a segment of your series by an interpolation like您可能适合正弦函数,但对于相位差( delta phi=2pi 频率 delta t ),检测和比较过零(相应的可能恒定偏移)就足够了,这可以从您的一段中找到插值系列

w=6.38    # some radian frequency
t = np.linspace(0, 0.5)   # time interval containing ONE zero-crossing
delta_phi=0.1   # some phase difference
x = np.sin(w*t-delta_phi)    # x(t)
f = interpolate.interp1d(x, t)     # interpolate t(x), default is linear 
delta_t = f(0)    # zero-crossing time referred to t=0
delta_phi_detected= w*delta_t

You need to relate two adjacent zero-crossings of your signals.您需要关联信号的两个相邻零交叉点。

Alternatively, you may obtain an average value by multiplication of both signals and numerical integration over time T which converges to (T/2)cos(delta_phi) , if both signals have (or are made to) zero mean value.或者,如果两个信号都具有(或被制成)零平均值,您可以通过将两个信号乘以时间 T 上的数值积分来获得平均值,该时间T收敛到(T/2)cos(delta_phi)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM