Mercurial > hg > smallbox
comparison util/SMALL_swipe.m @ 24:fc395272d53e
(none)
author | idamnjanovic |
---|---|
date | Tue, 27 Apr 2010 13:33:00 +0000 |
parents | 33850553b702 |
children | 8e660fd14774 |
comparison
equal
deleted
inserted
replaced
23:636a2a3d7302 | 24:fc395272d53e |
---|---|
1 function [p,s] = SMALL_swipe(X,fs, f, plim,dlog2p,dERBs,woverlap,sTHR) | 1 function [p,s] = SMALL_swipe(X,fs, f, plim,dlog2p,dERBs,woverlap,sTHR) |
2 % | 2 % |
3 % Ivan Damnjanovic 2010 | 3 % |
4 % | 4 % Centre for Digital Music, Queen Mary, University of London. |
5 % This is modified swipep MATLAB code that is working directly in spectral | 5 % This file copyright 2009 Ivan Damnjanovic. |
6 % domain and uses only one window size. The results are suboptimal | 6 % |
7 % comparing to original code. It is also converted to SWIPE which uses all | 7 % This program is free software; you can redistribute it and/or |
8 % the harmonics of the signal. | 8 % modify it under the terms of the GNU General Public License as |
9 % | 9 % published by the Free Software Foundation; either version 2 of the |
10 %SWIPEP Pitch estimation using SWIPE'. | 10 % License, or (at your option) any later version. See the file |
11 % COPYING included with this distribution for more information. | |
12 % | |
13 % | |
14 % This is modified swipep MATLAB code that is working directly in spectral | |
15 % domain and uses only one window size. The results are suboptimal | |
16 % comparing to original code. It is also converted to SWIPE which uses all | |
17 % the harmonics of the signal. | |
18 % | |
19 % SWIPEP Pitch estimation using SWIPE'. | |
11 % P = SWIPEP(X,Fs,[PMIN PMAX],DT,DLOG2P,DERBS,STHR) estimates the pitch | 20 % P = SWIPEP(X,Fs,[PMIN PMAX],DT,DLOG2P,DERBS,STHR) estimates the pitch |
12 % of the vector signal X every DT seconds. The sampling frequency of | 21 % of the vector signal X every DT seconds. The sampling frequency of |
13 % the signal is Fs (in Hertz). The spectrum is computed using a Hann | 22 % the signal is Fs (in Hertz). The spectrum is computed using a Hann |
14 % window with an overlap WOVERLAP between 0 and 1. The spectrum is | 23 % window with an overlap WOVERLAP between 0 and 1. The spectrum is |
15 % sampled uniformly in the ERB scale with a step size of DERBS ERBs. The | 24 % sampled uniformly in the ERB scale with a step size of DERBS ERBs. The |
58 % ylabel('Pitch (Hz)') | 67 % ylabel('Pitch (Hz)') |
59 % | 68 % |
60 % REFERENCES: Camacho, A., Harris, J.G, (2008) "A sawtooth waveform | 69 % REFERENCES: Camacho, A., Harris, J.G, (2008) "A sawtooth waveform |
61 % inspired pitch estimator for speech and music," J. Acoust. Soc. Am. | 70 % inspired pitch estimator for speech and music," J. Acoust. Soc. Am. |
62 % 124, 1638-1652. | 71 % 124, 1638-1652. |
72 | |
63 if ~ exist( 'plim', 'var' ) || isempty(plim), plim = [30 5000]; end | 73 if ~ exist( 'plim', 'var' ) || isempty(plim), plim = [30 5000]; end |
64 %if ~ exist( 'dt', 'var' ) || isempty(dt), dt = 0.001; end | 74 %if ~ exist( 'dt', 'var' ) || isempty(dt), dt = 0.001; end |
65 if ~ exist( 'dlog2p', 'var' ) || isempty(dlog2p), dlog2p = 1/48; end | 75 if ~ exist( 'dlog2p', 'var' ) || isempty(dlog2p), dlog2p = 1/48; end |
66 if ~ exist( 'dERBs', 'var' ) || isempty(dERBs), dERBs = 0.05; end | 76 if ~ exist( 'dERBs', 'var' ) || isempty(dERBs), dERBs = 0.05; end |
67 % if ~ exist( 'woverlap', 'var' ) || isempty(woverlap) | 77 % if ~ exist( 'woverlap', 'var' ) || isempty(woverlap) |