Re: Seasonal Variation in Trend Analysis [message #56070 is a reply to message #56069] |
Thu, 27 September 2007 10:26   |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"David Fanning" <news@dfanning.com> wrote in message
news:MPG.21655a1d1487d44b98a09d@news.frii.com...
> Ingo von Borstel writes:
>
>> I'd do a Fourier transform, filter out the terms that correspond to the
>> seasonal frequency/ies and possibly do a back-transform.
>
> Well, I can see this is what I *want* to do, but I
> am still having some trouble with the *how* to do. :-)
>
> For example, how, exactly, would I construct such
> a filter. To knock out the first harmonic, would
> I construct a circular filter near the origin? How
> near?
As a quick answer, FFT the data (assuming regular sampling etc)
and find the frequency corresponding to the seasonal signal.
(frequencies are i/NT where T is the sampling interval - for instance
one measurement each day).
Multiply your spectrum with zero at that point (and 1 every other point)
(also do that for the negative frequency component - assuming real data).
Invert the FFT.
You have removed the precise seasonal frequency.
You can perhaps improve that by multiplying the adjacent frequencies
by 0.5 above (i.e. your mask is 1,1,1,1,1,1....1,1 ,0.5,0,0.5,1,1.....)
That is equivalent to applying a hanning window filter to remove the
seasonal signal.
Sorry for brief description, I am taking care of a 2.5 yr old with the flu
right now so I have to be quick.
Cheers,
bob
|
|
|