Hilbert transformation is another technique to transform time series and R uses the seewave
package for this. This package can be installed using install.packages()
and loaded into the workspace using the library()
command:
> model <- hilbert(dji, 1)
The first parameter is the time series object which you would like to transform, and the second parameter is the sampling frequency of the wave. In the preceding example, I used dji
as time series and sampling frequency as 1 to calculate the Hilbert transformation.
If you would like to know the output of the model then you should use the following code:
> summary(model) V1 Length:2555 Class :complex Mode :complex
The preceding output mentions the length of input data series is 2555
and the type of output variable named model
is complex.
As the output is complex, we can extract real and imaginary values using the following code:
>rp<- Re(model) >...