FFT的振幅不正确
27 views (last 30 days)
Show older comments
Hey there,
我想计算3期逆变器的功率输出。因此,我必须对我的电压信号进行FFT,以获得基本的幅度。
In comparison to the FFT Tool from the Simulink powergui, my amplitude is always lower. I searched for some examples for a correct scaled FFT, but i cant find differences to my code.
f1 = ac_voltage_a.data(StecteSTATE:1:Stestentstate+2^15);当系统处于稳定状态时,使用%a序列向量
g1 = hanning(长度(f1))。*f1;% Using the hanning window
dt=Tsample%tsample = 1e-6
vac_fenstera_Nfft = length(g1);%采样值
j = fft(g1);% FFT
vac_fenstera_sfft = 2*abs(j)/vac_fenstera_nfft;%
plot(1/dt * (0:(vac_fenstera_Nfft/2-1)) / vac_fenstera_Nfft, (vac_fenstera_sfft(1:vac_fenstera_Nfft/2)));
与PowerGui的FFT分析工具相比,我的基本幅度的值仅是大小的一半,即使我却使ABS*2。
Where is my fault?
Is it nessesary that the length of g1 is a multiple of 2? I think a DFT could also work out.
Regards
Accepted Answer
David Goodmanson
在17 May 2021
编辑:David Goodmanson
在17 May 2021
Hi Meikel,
您将信号时间乘以一个窗口,从而降低了信号幅度。这必须对FFT产生重大影响。下面的代码显示了效果,该效果对于(错误的)Hanning窗口将基本窗口降低了2倍。
For an oscillation at one frequency, the peak amplitude in the frequency domain is reduced by a factor equal to the average value of the window function. Since the Hann window is a cos^2 function, and since the average value of cos^2 is 1/2, the frequency domain peak is reduced by that amount.
n = 1000;% signal length
t =(0:n-1)/n;
f0 = 40;
y = cos(2*pi*f0*t)/n;
yh =(cos(2*pi*f0*t)/n)。*hanning(n)';
f =(0:n-1);
yf = fft(y);
yfH = fft(yH);
ind = 1:N/2;
图1)
stem(f(ind),2*abs(yf(ind)))
网格在
图(2)
stem(f(ind),2*abs(yfH(ind)))
网格在
More Answers (0)
See Also
Categories
s manbetx 845
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
开始狩猎!