I have measurements of time and current which were made with a digital oscilloscope. When I import them in MATLAB and plot them my sinewave is pretty much like my the waveform I saw in the oscilloscope and in the excel file (time domain).
The problem is that, when i try to apply fft to my data, i'm taking this waveform as a result.
I think, that i should see my only harmonic in 50Hz, since there is a 50Hz sinewave taken as an input. Instead I'm taking a nearly zero harmonic. I think that I probably haven't understood something quite well here and I'm getting really confused about my problem.Can anyone help me?
Here is my code:
t=xlsread('C:\Users\Riko\Documents\MATLAB\Meas_V5_L2','A2:A10001');
I=xlsread('C:\Users\Riko\Documents\MATLAB\Meas_V5_L2','C2:C10001');
figure(1)
plot(t,I,'r');
xlabel('time (s)')
ylabel('current(A)')
grid on
N = 2^nextpow2(length(I));
Y = fft(I,N);
Fs = 5000; %Sampling frequency z
f = Fs/2*linspace(0,1,N);
p = abs(Y)/N; %Power of signal figure(2)
plot(f,p)
Thanks, in advance!
Best Answer