f2st: Convert between frequency in Hz and in semitones

View source: R/hqmisc.R

f2stR Documentation

Convert between frequency in Hz and in semitones

Description

Convert between frequency in Hz and in semitones, relative to baseline frequency in Hz.

Usage

f2st( hz, base=50 )
st2f( st, base=50 )

Arguments

hz

a frequency in Hertz (cycles per second).

st

a frequency in semitones relative to the base frequency.

base

the baseline frequency (in Hertz units) relative to which semitones are expressed.

Details

These functions convert between the linear Hertz and logarithmic semitone scales. A doubling of the frequency in Hz equals 12 semitones or 1 octave.

Function f2st was based on function h2st by Mark Liberman
(last seen at http://ldc.upenn.edu/myl/llog/semitones.R but no longer available online).
Function st2f was based on a conversion script by Jan Roelof de Pijper
(last seen at http://users.abo.fi/jtuomain/speech/semitone.html but no longer available online).

For frequencies in Hz of musical notes, see e.g. http://www.phy.mtu.edu/~suits/notefreqs.html.

Value

Transformed value(s) in semitones or in Hertz (cycles per second).

See Also

f2bark, bark2f, f2mel, mel2f.

Examples

# distance in semitones between target and baseline frequencies in Hz.
f2st( 440, base=110 )

# frequency in Hz of a tone that is +24 semitones distant 
# from the baseline, i.e. a distance of +two octaves.
st2f( 24 ) 

hqmisc documentation built on May 9, 2022, 5:08 p.m.

Related to f2st in hqmisc...