fft using matlab

Thread Starter

Marie

Joined Nov 20, 2007
24
Hi,

I had to design a three phase four wire system supplying non linear loads using simulink. The aim was to obtain the harmonic content generated by these loads. I was successful in the design. However, I could not get the fft using the powergui from simpowersystems (for some unknown reasons it is not available on my cd). So, I've tried to send the data to workspace where i have written an M-file to generate the fft.

Unfortunately, it does not seem to be that easy. I fail to get the harmonic frequencies and I just can't interprete the graph i have obtained. It does not make sense since the ac current has a fundamental at 50Hz and the graph i obtain contains just a dc component.

I've attached a schematic of the circuit i simulated + M-file.

Can anyone suggest an easier way to get the harmonic content?

Thanks
 

Attachments

Thread Starter

Marie

Joined Nov 20, 2007
24
Hi,

Well probably i don't know how to interprete the graph but there are a few queer things:

1) i'm measuring the supply current which is ac with fundamental at 50 Hz n the graph shows me a dc component only.

2) then, i would expect to get the magnitude of the current to be around 2A but the y-axis seems to represent something else.

Well, for (2) it is possible that the yaxis scale is according to DFT so that i should consider the length of sequence etc[sorry but my knowledge of DFT is quite limited], but what about the frequency?

This is why i'm looking for another way or a way to correct the one i proposed.

Thanks
 

koco

Joined Oct 22, 2008
1
Hi,
Is seems that you did not use a frequency series to display x-axis in a proper way. It is not included in attached file. If there are a lot of N-points in FFT it is possible to obtain long output array.
You could do sth like this:
Rich (BB code):
ff = 50;              % Fundamental frequency
T = 1/ff;
t_start = 0;
t_end = 1*T;
fs = 1e4;             % Sampling frequency
Ts = 1/fs;            % Sample time
t = t_start:Ts:t_end; % Time vector
L = size(t,2);
N = 2^nextpow2(L);
Y = fft(y,N);
f = fs/N*(0:N/2-1);
plot(f,2*abs(Y(1:N/2))),xlim([0 5*ff]),
Hope it helps.
koco
 
Top