快速傅立叶变换。频率和时间样本之间的相关性
FFT. Correlation between frequency and time samples
时间样本和频率之间的相关性是什么?
我有 250 个样本对应于我信号的 1 秒(对于特定点)和 500 个样本分别对应于 2 秒。频率的主要公式是f = 1 / T。因此,我拥有的时间样本越多,我认为我的频率应该越低。
代码:
#frequence
fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot(111)
pointdat=tracesM[361,28*250:(28+2)*250]
this = np.fft.fft(pointdat-np.mean(pointdat))
thisi = int(len(this))
thisii = np.abs(this[:(thisi)])
print(max(thisii))
plt.plot(thisii)
plt.grid(color='black')
plt.title('2s for specific point(361 in this situation)')
plt.xlabel('number of time samples(frequency?)')
plt.ylabel('power')
import matplotlib.ticker as plticker
loc = plticker.MultipleLocator(base=20)
locY = plticker.MultipleLocator(base=10)
ax.xaxis.set_major_locator(loc)
ax.yaxis.set_major_locator(locY)
plt.show()
我有图表:
1. enter image description here
2.enter image description here
据我所知,我应该使用 np.fft.fft 在图表中了解功率(信号)和频率的相关性。但看起来我得到了功率(信号)和时间样本的依赖性:250 和 500 个样本分别对应于 1 秒和 2 秒。
主要问题:
1. 我对这些图表有什么依赖?
2. 这些图表中的 T(周期)值是多少?
如果dt是时间步长,df是频率步长,N是样本数,那么对于离散傅立叶变换我们有
dt*df = 2*pi/N
如果T是总采样长度,我们有
dt = T/N
df = 2*pi/T
算出你的 df 并将你的频率轴乘以 df。
时间样本和频率之间的相关性是什么?
我有 250 个样本对应于我信号的 1 秒(对于特定点)和 500 个样本分别对应于 2 秒。频率的主要公式是f = 1 / T。因此,我拥有的时间样本越多,我认为我的频率应该越低。
代码:
#frequence
fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot(111)
pointdat=tracesM[361,28*250:(28+2)*250]
this = np.fft.fft(pointdat-np.mean(pointdat))
thisi = int(len(this))
thisii = np.abs(this[:(thisi)])
print(max(thisii))
plt.plot(thisii)
plt.grid(color='black')
plt.title('2s for specific point(361 in this situation)')
plt.xlabel('number of time samples(frequency?)')
plt.ylabel('power')
import matplotlib.ticker as plticker
loc = plticker.MultipleLocator(base=20)
locY = plticker.MultipleLocator(base=10)
ax.xaxis.set_major_locator(loc)
ax.yaxis.set_major_locator(locY)
plt.show()
我有图表: 1. enter image description here 2.enter image description here
据我所知,我应该使用 np.fft.fft 在图表中了解功率(信号)和频率的相关性。但看起来我得到了功率(信号)和时间样本的依赖性:250 和 500 个样本分别对应于 1 秒和 2 秒。
主要问题: 1. 我对这些图表有什么依赖? 2. 这些图表中的 T(周期)值是多少?
如果dt是时间步长,df是频率步长,N是样本数,那么对于离散傅立叶变换我们有
dt*df = 2*pi/N
如果T是总采样长度,我们有
dt = T/N
df = 2*pi/T
算出你的 df 并将你的频率轴乘以 df。