Learn R Programming

musclesyneRgies (version 1.2.5)

FWHM: Full width at half maximum

Description

Full width at half maximum

Usage

FWHM(x, sub_minimum = TRUE)

Value

The full width at half maximum of the time series.

Arguments

x

A time series (numeric)

sub_minimum

Logical; should the minimum be subtracted before amplitude normalisation?

References

Martino, G. et al. Locomotor patterns in cerebellar ataxia. J. Neurophysiol. 112, 2810–2821 (2014).

Examples

Run this code
# Number of users connected to the Internet through a server every minute
ts <- datasets::WWWusage

# Calculate FWHM
ts_FWHM <- FWHM(ts)

# Half maximum (for the plots)
hm <- min(ts) + (max(ts) - min(ts)) / 2
hm_plot <- ts
hm_plot[which(hm_plot > hm)] <- hm
hm_plot[which(hm_plot < hm)] <- NA

# Plots
plot(ts, ty = "l", xlab = "Time", ylab = "Number of users")
lines(hm_plot, lwd = 3, col = 2)

Run the code above in your browser using DataLab