One-sided HP filter

Dear Johannes,

Thank you for your reply.
All I did was
[Ytrend, Yobs] = one_sided_hp_filter_serial(log(Y))

where Yobs gives the cyclical component. Alternatively, Yobs = 100*(log(Y)-Ytrend) still gives the same output, which has a non-zero mean.

The Matlab file came from (ideas.repec.org/c/dge/qmrbcd/181.html) and the Eviews add-in (from their website) gives identical results.
us_gdp1.xls (33.5 KB)
one_sided_hp_filter_kalman.m (5.38 KB)