d8098edAn interactive tutorial on the wave equation in acoustics: strings, drums and rooms, measured by earJeremy Magland 1function c = wv_cents(f, fref)
2% WV_CENTS The interval from fref up to f, in cents.
3%
4% A cent is a hundredth of an equal-tempered semitone, so an octave is 1200
5% cents and a relative frequency error e is about 1731 e cents when e is
6% small. Negative means flat.
7c = 1200 * log2(f ./ fref);
8end