1 #ifndef _PITCHDETECTOR_H
2 #define _PITCHDETECTOR_H 1
12 PitchDetector(unsigned sample_rate, unsigned fft_length, unsigned pad_factor, unsigned overlap);
14 std::pair<double, double> detect_pitch(short *buf);
24 double *in, *in_windowed;
25 std::complex<double> *out;
31 void apply_window(double *in, double *out, unsigned num_samples);
32 void find_peak_magnitudes(std::complex<double> *in, double *out, unsigned num_samples);
33 std::pair<double, double> find_peak(double *in, unsigned num_samples);
34 std::pair<double, double> adjust_for_overtones(std::pair<double, double> base, double *in, unsigned num_samples);
35 double bin_to_freq(double bin, unsigned num_samples);
36 double freq_to_bin(double freq, unsigned num_samples);
37 std::pair<double, double> interpolate_peak(double ym1, double y0, double y1);
40 #endif /* !defined(_PITCHDETECTOR_H) */