Learn R Programming

emuR (version 2.5.0)

rad: Function to convert between Hertz and Radians

Description

convert between Hertz and Radians

Usage

rad(vec, samfreq = 20000, hz = TRUE)

Arguments

vec

A numerical vector of frequencies in Hz or radians

samfreq

A single element numerical vector of the sampling frequency. Defaults to 20000 Hz

hz

Logical. If TRUE, convert from Hz to radians otherwise from radians to hz

Author

Jonathan Harrington

See Also

Examples

Run this code

# 4000 Hz in radians at a sampling frequency of 8000 Hz
rad(4000, 8000)
# pi/2 and pi/4  radians in Hz at a sampling frequency of 10000 Hz
rad(c(pi/2, pi/4), 10000, FALSE)


Run the code above in your browser using DataLab