Skip to content

Instantly share code, notes, and snippets.

@ethe
ethe / HPS.m
Created December 3, 2019 09:45 — forked from sakamoto-poteko/HPS.m
HPS algorithm for tone detection
function [ freq ] = HPS(audiofile)
CORRECTFACTOR=1;
[sample, fs] = audioread(audiofile);
fftn = fs;
sample = sample .* hann(length(sample));
fftr = abs(fft(sample,fftn));
fftr = fftr(1:fftn/2);