dutyCycle: Calculate the duty cycle of a wave

Description Usage Arguments Value Examples

View source: R/dutyCycle.R

Description

Proportion of a wave with signal above the limit

Usage

1
dutyCycle(wave, limit = 0.1, output = "unit", normalise = TRUE)

Arguments

wave

A Wave object

limit

Threshold above which to consider the signal

output

If "unit" the duty cycle will be in the range 0-1. For a percentage use "percent".

normalise

If TRUE the Wave is normalised using tuneR

Value

A numerical value for the duty cycle between 0 and 1 (or 0 and 100

Examples

1
2
3
wave <- tuneR::sine(2000)
dc <- dutyCycle(wave)
pc <- dutyCycle(wave, output="percent")

sonicscrewdriver documentation built on May 2, 2021, 5:06 p.m.