FFT的振幅不正确

27 views (last 30 days)
Meikel Vollmers
Meikel Vollmers 在17 May 2021
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
4条评论
Meikel Vollmers
Meikel Vollmers 在17 May 2021
Sure, data file is attached. The fundamental is 1060Hz. Powergui FFT says the amplitude is 333V, my calculation says 167V.
SteadyState = 350000;

Sign in to comment.

Accepted Answer

David Goodmanson
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)))
网格
1 Comment
Meikel Vollmers
Meikel Vollmers 在17 May 2021
嘿,大卫,谢谢您的答案!
Windowing is important, but i have never read about the reduction by the average value of the windowing function. So i will just multiply my spectrum with another factor of 2. Thank you!

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!