ShepardTone: Shepard Tone

View source: R/ShepardTone.R

ShepardToneR Documentation

Shepard Tone

Description

This function generates a Shepard tone.

Usage

ShepardTone(inMainFreq, inDuration = 1, inSampleFreq = 22050,
            inPhaseFlag = 1, indBLevel = NULL)

Arguments

inMainFreq

the main frequency (in Hz).

inDuration

the duration (in s). If empty or not specified, 1 is used by default.

inSampleFreq

the desired sample frequency for the output signal (in Hz). If empty or not specified, 22050 is used by default.

inPhaseFlag

for choosing whether random phase is to be used or not (1 to use random phase, 0 otherwise). If empty or not specified, 1 is used by default.

indBLevel

dB level of generated tone (in dB) if empty or not specified, no level adjustment is performed.

Value

outSignal, the signal for the tone in numeric class.

Note

To convert the output to "Wave" class use tuneR::Wave and tuneR::normalize functions.

Author(s)

Marc Vidal (R version). Based on the original code from IPEM Toolbox.

Examples

# Note D
D <- ShepardTone(293.66, indBLevel = -20)

m-vidal/eaR documentation built on Nov. 18, 2022, 3:55 p.m.