您可以通过傅立叶变换计算原始信号的幅度/功率吗? [英] Can you compute the amplitude/power of original signal from Fourier transform?

查看:180
本文介绍了您可以通过傅立叶变换计算原始信号的幅度/功率吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用scipy.fftpack.fft()进行了一些样本的离散傅立叶变换并绘制了它们的幅度后,我注意到它不等于原始信号的幅度.两者之间有关系吗?

After taking the Discrete Fourier Transform of some samples with scipy.fftpack.fft() and plotting the magnitude of these I notice that it doesn't equal the amplitude of the original signal. Is there a relationship between the two?

有没有一种方法可以根据傅立叶系数来计算原始信号的幅度而无需逆变换?

Is there a way to compute the amplitude of the original signal from the Fourier coefficients without reversing the transform?

这是一个振幅为7.0且fft振幅为3.5的正弦波的示例

Here's an example of sin wave with amplitude 7.0 and fft amplitude 3.5

from numpy import sin, linspace, pi
from pylab import plot, show, title, xlabel, ylabel, subplot
from scipy import fft, arange

def plotSpectrum(y,Fs):
 """
 Plots a Single-Sided Amplitude Spectrum of y(t)
 """
 n = len(y) # length of the signal
 k = arange(n)
 T = n/Fs
 frq = k/T # two sides frequency range
 frq = frq[range(n/2)] # one side frequency range

 Y = fft(y)/n # fft computing and normalization
 Y = Y[range(n/2)]

 plot(frq,abs(Y),'r') # plotting the spectrum
 xlabel('Freq (Hz)')
 ylabel('|Y(freq)|')

Fs = 150.0;  # sampling rate
Ts = 1.0/Fs; # sampling interval
t = arange(0,1,Ts) # time vector

ff = 5;   # frequency of the signal
y = 7.0 * sin(2*pi*ff*t)

subplot(2,1,1)
plot(t,y)
xlabel('Time')
ylabel('Amplitude')
subplot(2,1,2)
plotSpectrum(y,Fs)
show()

推荐答案

是的, Parseval定理告诉我们总和频域中的功率等于时域中的总功率.

Yes, Parseval's Theorem tells us that the total power in the frequency domain is equal to the total power in the time domain.

您可能会看到的是前向FFT中缩放因子的结果.此缩放因子的大小是一个约定问题,但最常见的是N的因子,其中N是数据点的数量.但是,它也可以等于1或sqrt(N).请查看您的FFT文档.

What you may be seeing though is the result of a scaling factor in the forward FFT. The size of this scaling factor is a matter of convention, but most commonly it's a factor of N, where N is the number of data points. However it can also be equal to 1 or sqrt(N). Check your FFT documentation for this.

还要注意,如果仅从一半频域单元中获取功率(通常在时域信号是纯实信号并且在频域中具有复杂的共轭对称性时完成),那么将有2的因数保重.

Also note that if you only take the power from half of the frequency domain bins (commonly done when the time domain signal is purely real and you have complex conjugate symmetry in the frequency domain) then there will be a factor of 2 to take care.

这篇关于您可以通过傅立叶变换计算原始信号的幅度/功率吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆