Skip to content

TS implementation of the YIN algorithm for fundamental frequency detection

Notifications You must be signed in to change notification settings

daniele-roncaglioni/yin-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YIN

Faithful YIN algorithm implementation for fundamental frequency estimation according to the seminal paper and nothing else. Deviations from paper are documented in the code.

Usage

In node.js:

const yin = require("./dist/cjs/yin.js").default;
// sine wave with f0 = 440 Hz and sample rate of 8000 Hz sampled for 1024 samples
let signal = Array.from({length: 8000}, (_, i) => Math.sin(2 * Math.PI * 440 * i / 8000));
console.log(yin(signal, 8000, 0.2))

Output:

440.64565401846073

About

TS implementation of the YIN algorithm for fundamental frequency detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published