简体   繁体   English

正确的摆幅fft

[英]correct amplitude of pwelch fft

I have a simple sinus signal with some noise. 我有一个简单的鼻窦信号,但有些杂音。 If I try a simple FFT algorithm I get the amplitude of the signal(23) and the freq(2). 如果我尝试一种简单的FFT算法,则会得到信号(23)和频率(2)的幅度。 If I try the pwelch from Matlab with hanning window I am getting the right freq but the amplitude is wrong. 如果我尝试使用带有Hanning窗口的Matlab进行安装,则得到的频率正确,但是幅度是错误的。 How can I obtain the real amplitude? 如何获得真实振幅? This is the code I am using for the pwelch: 这是我正在使用的代码:

time = 0:0.01:50;
frequency = 2;
amplitude = 23;
y = amplitude * sin (2 * pi * frequency * time);
y= y + 6 * randn(size(time));
y = y - mean(y);
N = length(y);
Fs = 100;
NFFT = 2^nextpow2(N);
M = 4396;
w = hanning(M);
[Pyy,Fy] = pwelch(y, w,[],M,Fs);
plot(Fy,Pyy);

IMHO, you cannot due to the spectral leakage . 恕我直言,由于频谱泄漏 ,您不能这样做。 If you see the Hanning window that you are using, it is a low pass filter (when centred and normalised). 如果看到正在使用的Hanning窗口,则它是低通滤波器(居中并归一化时)。 It will reduce the power at the main frequencies and it will introduce power at other frequencies, ie smoothing. 它将降低主频率上的功率,并将引入其他频率上的功率,即平滑。 But, it is an aperiodic signal with infinite duration in the frequency domain, which cannot be computed. 但是,它是在频域中具有无限持续时间的非周期性信号,无法计算。

figure; 
plot(w);
title(['Hanning window with ', num2str(M), 'points']);

在此处输入图片说明

You can read more here . 您可以在这里阅读更多内容。

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

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