Can anyone help me by telling how I can I do FFT calculations for a collected neutral current data?

3 views (last 30 days)
I have collected current data of 5000samples/sec and one cycle takes 20ms. I want to find the harmonic emission from this. I have attached a part of the collected data.
I need your kind help to convert this frequency data to time domain data and using FFT to find the harmonic current there.
It would be highly appreciated if you kindly help me and guide me to do this
Thanking you
  1 Comment
Daniel kiracofe
Daniel kiracofe on 4 Jul 2014
not sure exactly what you are asking here. you first paragraph to me implies that you have time domain data and you want to convert to frequency domain. then in second paragraph you state you have frequency domain and you want to convert to time domain. And then you say you want to do an FFT, implying that you have time domian that you want to compute to frequency domain. So it's not clear to me what you are asking.
I'll assume that you do indeed have time domain data and you want to do an FFT. The first thing you need to know is that matlab's fft() function is not very useful by itself. You will want to call it using a wrapper script. Below you can find a simple wrapper script that I use.
% function [frq, amp, phase] = simpleFFT( signal, ScanRate)
% Purpose: perform an FFT of a real-valued input signal, and generate the single-sided
% output, in amplitude and phase, scaled to the same units as the input.
%inputs:
% signal: the signal to transform
% ScanRate: the sampling frequency (in Hertz)
% outputs:
% frq: a vector of frequency points (in Hertz)
% amp: a vector of amplitudes (same units as the input signal)
% phase: a vector of phases (in radians)
function [frq, amp, phase] = simpleFFT( signal, ScanRate)
n = length(signal);
z = fft(signal, n); %do the actual work
%generate the vector of frequencies
halfn = n / 2;
deltaf = 1 / ( n / ScanRate);
frq = (0:(halfn-1)) * deltaf;
% convert from 2 sided spectrum to 1 sided
%(assuming that the input is a real signal)
amp(1) = abs(z(1)) ./ (n);
amp(2:halfn) = abs(z(2:halfn)) ./ (n / 2);
phase = angle(z(1:halfn));
You can find a detailed explanation of this script, and possibly some other useful stuff at my website: http://www.mechanicalvibration.com/Making_matlab_s_fft_functio.html

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!