st: Convert Herz to Semitones

View source: R/rendeeR_psychoacoustics.R

stR Documentation

Convert Herz to Semitones

Description

This function takes a vector of frequencies (in Hz) and convert them to semitones. By default, the frequency of the note C$_0$ is used as the reference for the conversion, so that the output is compatible with the defined base of a Phonogram \insertCiteSchutte.1983.10.1159/000265703reindeer.

Usage

st(x, ref = 16.3516)

Arguments

x

A vector of frequency values (in Hz)

ref

The reference frequency. By default 16.35160 Hz (C$_0$) which is the base frequency setting of a Phonogram.

Details

For Praat-compatible output please use one of 1, 100, 200, or 440 Hz as the reference frequency.

Value

Returns a vector of semitone scaled frequency values.

Author(s)

Fredrik Karlsson

References

\insertAllCited

Examples

h <- seq(100,5000,100)
# Praat has 100 Hz as one of the reference frequency options for semitone calculations
s100 <- st(h,ref=100)
# Semitone distance from C_0
sC0 <- st(h)
#The differ between semitones relative to C0 and a 100 Hz frequency
st(h,ref=100) - st(h)
# phonogram (C0-C4) range in Semitones
strange <- st(261.6256)
strange

humlab-speech/reindeer documentation built on May 21, 2023, 4:43 p.m.