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.
Curve Fitting for FFT plot
5 次查看(过去 30 天)
显示 更早的评论
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!