|
楼主 |
发表于 2009-12-18 09:18
|
显示全部楼层
谢谢fighterjzh。但结果出来后我觉得有问题,主要是高通滤波后均值发生了漂移。请看附件中的图。程序代码如下:
dT = 30; % min
N = 7*24*60/dT; t = (0:N-1)*dT; % data for 7 days
pnoise = 0.30; T1 = 12.4*60; T2 = 24*60; T3 = 15*24*60; Tc = 10*60; % min
xn = 5 + 3*cos(2*pi*t/T1) + 2*cos(2*pi*t/T2) + 1*cos(2*pi*t/T3);
xn = xn + pnoise*max(xn-mean(xn))*(0.5 - rand(size(xn)));
[xs,c,h,Cx,f] = lanczosfilter(xn,dT,1/Tc,[],'low');
[xs2,c2,h2,Cx,f] = lanczosfilter(xs,dT,1/Tc/2,[],'high');
subplot(211), plot(t,xn,'r',t,xs,'b',t,xs2,'k'); legend('xn','xs','xs2'); %axis tight
subplot(212), plot(f,h,f,h2,f,abs(Cx)/max(abs(Cx)),[1 1]/Tc,[min(h) max(h)],'-.',...
[1/T1 1/T2 1/T3],([1/T1 1/T2 1/T3]<=1/Tc),'o');
请问这个结果正确吗?
请大家不吝指教。多谢!!
|
|