フィルターのクリア

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 Center および File ExchangeParametric Spectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by