Integral Length Scales using the autocorrelation Function

I found these two methods to compute the Integral Length Scales using the autocorrelation Function. But both gave me very different results. I'm not sure about what is appening in the trapzoid function, if anyone can explain it to me or know what is the right approach is I would appreciate it.
u_HW = U_inst-mean(U_inst);
[Ruu_simm, TM_simm] = xcorr(u_HW,'coeff');
TM_simm = TM_simm./Fs;
Ruu = Ruu_simm(TM_simm>=0 & TM_simm<=0.5);
TM = TM_simm(TM_simm>=0 & TM_simm<=0.5);
fitresult_corr = fit(TM.',Ruu.','gauss8');
TM_fit = TM_simm(floor(length(TM_simm)/2)-100:end);
Ruu_fit = fitresult_corr(TM_fit);
TM_fit = TM_fit(Ruu_fit<=1);
Ruu_fit = Ruu_fit(Ruu_fit<=1);
Lags_t_domain = TM_fit(Ruu_fit >= 1e-5);
ACF_fit_domain = Ruu_fit(Ruu_fit >= 1e-5);
1-approach
Int_LS_AC = trapz(TM_fit,Ruu_fit);
2-approach
LS = trapz(TM(Ruu>=0),Ruu(Ruu>=0))+abs(trapz(TM(Ruu<0),Ruu(Ruu<0)));

답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

질문:

2021년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by