My Math Forum FFT on sample data

 Applied Math Applied Math Forum

 June 18th, 2009, 07:39 PM #1 Newbie   Joined: Jun 2009 Posts: 1 Thanks: 0 FFT on sample data Hi I am trying to perform Fast Fourier Transforms on sample data coming out of a load cell. (Load cells are weighing at 10items a second) I have got the data in excel (256 values = 3 items). I am using Matlab to do this. Code below: x=Load_Cell_Data(:,2) nfft= 2^(nextpow2(x)); % Use next highest power of 2 greater than or equal to length(x) to calculate FFT fftx = fft(x,nfft); % Take fft, padding with zeros so that length(fftx) is equal to nfft % Calculate the numberof unique points (half) NumUniquePts = ceil((nfft+1)/2); %ceil rounds up to nearest integer % FFT is symmetric, throw away second half fftx = fftx(1:NumUniquePts); % Take the magnitude of fft of x mx = abs(fftx) % Evenly spaced frequency vector with NumUniquePts points. f = (0:NumUniquePts-1) % Generate the plot, title and labels. plot(f,mx); title('FFT'); xlabel('Frequency (Hz)'); ylabel('Amplitude'); Comments added to show train of thoughts. I get a graph which doesn't look right. What am I missing in the code? I am not getting distinct frequency components which one would expect to see with such application. Thanks for your help in advance. Ramyy
 June 29th, 2009, 04:49 PM #2 Newbie   Joined: Jun 2009 Posts: 5 Thanks: 0 Re: FFT on sample data Looks wrong how? Shape or amplitude? I notice that you're not dividing the number of samples. fftx = fft(x,nfft)/nfft; Also, maybe try windowing? fftx = fft(x .* hann(nfft),nfft)/nfft;

 Tags data, fft, sample

,

,

### math fft sample

Click on a term to search for related topics.
 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post shivadiva Advanced Statistics 0 April 30th, 2013 07:46 PM lumpa Real Analysis 0 October 19th, 2012 08:07 AM Student@work Algebra 3 February 12th, 2012 08:17 AM Freddy7 Algebra 0 October 20th, 2011 08:52 AM BigLRIP Advanced Statistics 1 May 18th, 2009 10:01 AM

 Contact - Home - Forums - Cryptocurrency Forum - Top