SMAC-Group / wv

:alarm_clock: This R package provides the tools to perform standard and robust wavelet variance analysis for time series (signal processing). Among others, aside from computing the wavelet variance and cross-covariance (classic and robust), the package provides inference tools (e.g. confidence intervals) and plotting tools allowing to perform some visual analysis and assess the properties of the underlying time series.
https://smac-group.github.io/wv/
15 stars 10 forks source link

Strange units single wavelet plot in compare_wvar #13

Open stefangachter opened 3 years ago

stefangachter commented 3 years ago

If I call compare_wvar with a single wavelet variance object, then the plot is "degenerated", see image below.

lionelvoirol commented 3 years ago

Hi, Thanks for noticing this issue Stefan. Could you please provide a reproducible example so we can investigate the bug and solve it? Thanks!

stefangachter commented 3 years ago

Here, an example:

library(imudata)
library(gmwm)

imuObj <- list()
waveletVariances <- list()

data(adis_16405_imu1)
imuObj[length(imuObj)+1] <- list(imu(adis_16405_imu1, gyros=1:3, acc=4:6, axis=c('X', 'Y', 'Z'), freq=100))
waveletVariances[length(waveletVariances)+1] <- list(wvar.imu(imuObj[[length(imuObj)]]))

title = 'ADIS 16405 IMU1'
xLabel = 'Time Scale (s)'
yLabel = 'Variance'
unitAcc = 'm/s^2'
unitGyro = 'deg/s'
unitAccVar = paste('(', unitAcc, ')^2', sep='')
unitGyroVar = paste('(', unitGyro, ')^2', sep='')
legendLables = NULL

plotObj = do.call(compare_wvar, c(waveletVariances, list(split=FALSE, auto.label.wvar=FALSE, axis.x.label=xLabel, axis.y.label=yLabel, units=c(unitGyroVar, unitAccVar), title=title, legend.label=legendLables)))
plot(plotObj)

data(adis_16405_imu2)
imuObj[length(imuObj)+1] <- list(imu(adis_16405_imu2, gyros=1:3, acc=4:6, axis=c('X', 'Y', 'Z'), freq=100))
waveletVariances[length(waveletVariances)+1] <- list(wvar.imu(imuObj[[length(imuObj)]]))

title = 'ADIS 16405 IMU1 and IMU2'
legendLables = c('IMU1', 'IMU2')

plotObj = do.call(compare_wvar, c(waveletVariances, list(split=FALSE, auto.label.wvar=FALSE, axis.x.label=xLabel, axis.y.label=yLabel, units=c(unitGyroVar, unitAccVar), title=title, legend.label=legendLables)))
plot(plotObj)

image image