小编akk*_*kab的帖子

幅度和相位频谱。改变相位而不影响振幅

我有在相关点具有等效间隔和相应测量值的数据。例如,这是我拥有的数据的摘录:

y =[2.118, 2.1289, 2.1374, 2.1458, 2.1542, 2.1615, 2.1627, 2.165 2.1687...]

点之间的间隔为 0.1

所以,我需要从数据中获取的是幅度谱(幅度与频率)和相位谱(相位角与频率)。此外,我应该将数据的相位偏移负 90 度 (-pi/2)。

在移动相位并保持幅度不变时,我需要执行逆 fft 并获得新信号。我想在 Python 中做到这一点。

你能给我一个执行此操作的示例吗?

我使用的代码取自另一个 SO 问题,但我做了一些修改

## Perform FFT WITH SCIPY
signalFFT = np.fft.fft(y)

## Get Power Spectral Density
signalPSD = np.abs(signalFFT) ** 2
signalPhase = np.angle(signalFFT)

## Shift the phase py +90 degrees
new_signalPhase =(180/np.pi)*np.angle(signalFFT)+90 


## Get frequencies corresponding to signal 
fftFreq = np.fft.fftfreq(len(signalPSD), 0.1)

## Get positive half of frequencies
i = fftFreq>0

##
plt.figurefigsize=(8,4)
#plt.plot(fftFreq[i], 10*np.log10(signalPSD[i]));

plt.plot(fftFreq[i], …
Run Code Online (Sandbox Code Playgroud)

python signal-processing fft phase ifft

3
推荐指数
1
解决办法
7571
查看次数

标签 统计

fft ×1

ifft ×1

phase ×1

python ×1

signal-processing ×1