-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathexample_foCepstrum.m
More file actions
26 lines (21 loc) · 1.13 KB
/
example_foCepstrum.m
File metadata and controls
26 lines (21 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sample program for estimating Fo (fundamental frequency) based on %
% cepstrum analysis %
% %
% Coded by D. Kitamura (d-kitamura@ieee.org) %
% %
% See also: %
% http://d-kitamura.net %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear; close all; clc;
addpath('./input');
% parameters
fileName = 'a.wav'; % audio file name
fftSize = 4096; % FFT length (short-time length) for analysis
foMin = 80; % minimum frequency [Hz] for analysis
foMax = 400; % maximum frequency [Hz] for analysis
% Read wav fale
[signal,fs] = audioread(fileName); % fs is a sampling frequency [Hz]
% Fo estimation
estFo = foCepstrum(signal,fs,foMin,foMax,fftSize,'rectangular');
fprintf('Estimated Fo is %.5f [Hz].\n', estFo);