Hi everyone, I would like to estimate annual ans semi-annual signal from my data. Attached is my data as well as my coding, I managed to estimate bias and linear trend. However, I was stuck in estimating annual and semi-annual signal. I hope anyone can help me on this matter. Thank you.
A = load('FPT1.txt');t = A(:,1);slv = A(:,5);dt1 = num2str(t,'%.2f');dtm1 = datetime(dt1,'InputFormat','yyyyMMddHHmmss.SS');dtn1 = datenum(dtm1);dtmFill1 = fillmissing(dtm1,'linear');%%PARAMETER FIT
% hobs = h0 + h1T + h2*sin(2*pi*T) + h3*cos(2*pi*T) + h4*sin(4*pi*T) + h5*cos(4*pi*T)
% Estimate bias/offset
h0 = mean(slv);% Estimate linear trend
b = polyfit(dtn1,slv,1);h1 = polyval(b, dtn1);%% Stuck here
% Estimate Annual Signals [h2*sin(2*pi*T) + h3*cos(2*pi*T)]
% However, the time for this data is every 9.9156 days
% f1=1/(365*24); %frequency of 1 yr oscillations
h2 = sin(2*pi*T)/slv;h3 = cos(2*pi*T)/slv;% Estimate Semi-Annual Signals [h4*sin(4*pi*T) + h5*cos(4*pi*T)]
% f2=1/((365*24))/2; %frequency of 1/2 year oscillations
h4 = slv*sin(4*pi*T);h5 = slv*cos(4*pi*T);
Best Answer