# Amplitude of FFT is not correct

--

Hey there,

i want to calculate the power output of a 3 phase inverter. Therefore i have to do a FFT on my voltage Signals, to get the amplitude of the fundamental.

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(SteadyState:1:SteadyState+2^15); % A Timeseries vector is used when system is in steady stateg1 = hanning(length(f1)).*f1; % Using the hanning windowdt=Tsample  % Tsample = 1e-6vac_fenstera_Nfft = length(g1); % Sampled valuesJ = fft(g1); % FFTvac_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)));`

In comparison to the FFT analysis tool from powergui, the value of my fundamental amplitude is only half the size, even i mutiplied the 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.

`N = 1000;          % signal lengtht = (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);`