필터 지우기
필터 지우기

Curve fitting of PSD?

조회 수: 5 (최근 30일)
gaurav Nanda
gaurav Nanda 2012년 4월 23일
Hello, I need help for the curve fitting. I am using the following command but there is some problem with it.
NFFT=2^nextpow2(L);
Y1=fft(y-mean(y))/L; % Y1 is FFT
fc=Fs/2*linspace(0,1,NFFT/2+1);
Y2=2*abs(Y1(1:NFFT/2+1));%absolute value of FFT
Nc=(Y2).^2; % Nc is PSD
plot(fc,Nc);
g1=fittype('a1-x*p1', 'coef',{'a1','p1'});
options=fitoptions('Method','nonlinearleastsquares','lower',[-25 0], 'upper',[-5 4]);
options.startpoint=[-12,1];
options.TolFun=1e-12;
loglog(fc(1:length(fc)), Nc(1:NFFT/2+1),'b');
curvec= FIT(log10(fc(1:length(fc))),log10(Nc(1:NFFT/2+1)),g1);
=------------------------------- could you please tell me what is wrong with the command?
Thanks

답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by