Curve Fitting for FFT plot

4 次查看(过去 30 天)
nur yusof
nur yusof 2015-7-6
编辑: arun 2015-7-6
Hi all,
I have data from accelerometer(time domain) and convert it to fft. Below is my coding and the plot.
%Clear clc;
%For Sampling Rate 512
c= Ch_512_60mss'; Track2=c(1,1:4096); Track1_X_Resolution=(1/512); Fs = (1/Track1_X_Resolution); L=4096;%16385;
% Sampling frequency t =(0:L-1)*1/Fs;% 0:1/Fs:2;
x = Track2; nfft = 2^nextpow2(L); % Next power of 2 from length of y
% Length of FFT % Take fft, padding with ze X = fft(x,nfft); X = X(1:nfft/2);
% Take the magnitude of fft of x mx = abs(X);
% Frequency vector f = (0:nfft/2-1)*Fs/nfft; % f1=fit(t,f,'fourier8');
% Generate the plot figure(1); plot(t,x); title('Sine Wave Signal'); xlabel('Time (s)'); ylabel('Amplitude'); figure(2); plot(f,mx); title('Power Spectrum of a Sine Wave'); xlabel('Frequency(Hz)'); ylabel('Power');
However I need to do the curve fit to the plot. Can somebody share with me the coding.I don't know how to do it.
Thanks a lot.
  1 个评论
arun
arun 2015-7-6
编辑:arun 2015-7-6
Fitting only "one curve" for this random data may spoil ur upcoming analysis. U shall try piecewise fit even shat is not good for noisy data.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by