f0detectionyin.m File Reference

Go to the source code of this file.

Functions

init variable compute d (tau) x1
 
 d2 (1+lag)
 
 if (length(mloc)>0) I
 
 if (length(I)>0) candf0lag
 
candf0lag-1 d2 ()
 
id f0lag ()
 
compute candidate frequency in Hz if (ac > 0.2)%voiced/unvoiced threshold f0=0
 

Variables

function f0
 
function fs
 
function ws
 
function minf0
 
function maxf0
 
maximum lag th = 0.1
 
set threshold d = zeros(maxlag,1)
 
init variable d2 = zeros(maxlag,1)
 
 cumsumx = sum(x1.^2)
 
 cumsumxl = cumsumx
 
 xy = xcorr(x(1:ws*2),x1)
 
for lag
 
end cumsum = 0
 
end limit the search to the target range minf0lag = 1+round(fs./minf0)
 
compute lag corresponding to minf0 maxf0lag = 1+round(fs./maxf0)
 
compute lag corresponding to maxf0 if(maxf0lag >1 &&maxf0lag< maxlag) d2(1 avoid lags shorter than maxf0lag end if(minf0lag >1 &&minf0lag< maxlag) d2(minf0lag avoid lags larger than minf0lag end find the best candidate mloc = 1 + find((d2(2:end-1)<d2(3:end)).*(d2(2:end-1)<d2(1:end-2)))
 
minima candf0lag = 0
 
 else [Y, I2] = min(d2(mloc))
 
 val = d2(candf0lag)
 
 rval = d2(candf0lag+1)
 
end end ac = min(d2)
 
 f0lag = candf0lag-1
 

Function Documentation

init variable compute d ( tau  )
d2 ( 1+  lag)
candf0lag-1 d2 ( )
virtual
id f0lag ( )
virtual
if ( length(mloc ,
 
)
if ( length(I)  ,
 
)
compute candidate frequency in Hz if ( ac  ,
0.  2 
)
pure virtual

Variable Documentation

end end ac = min(d2)

Definition at line 54 of file f0detectionyin.m.

candf0lag = 0

Definition at line 36 of file f0detectionyin.m.

end cumsum = 0

Definition at line 18 of file f0detectionyin.m.

cumsumx = sum(x1.^2)

Definition at line 10 of file f0detectionyin.m.

cumsumxl = cumsumx

Definition at line 11 of file f0detectionyin.m.

set threshold d = zeros(maxlag,1)

Definition at line 6 of file f0detectionyin.m.

init variable d2 = zeros(maxlag,1)

Definition at line 7 of file f0detectionyin.m.

else[Y, I2] = min(d2(mloc))

Definition at line 42 of file f0detectionyin.m.

Initial value:
= f0detectionyin(x,fs,ws,minf0,maxf0)
% x: input signal
function fs
Definition: f0detectionyin.m:1
Discrete Time axis x
function ws
Definition: f0detectionyin.m:1
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an input
function maxf0
Definition: f0detectionyin.m:1
function minf0
Definition: f0detectionyin.m:1

Definition at line 1 of file f0detectionyin.m.

f0lag = candf0lag-1

Definition at line 55 of file f0detectionyin.m.

Definition at line 1 of file f0detectionyin.m.

for lag
Initial value:
=0:maxlag-1
d(1+lag) = cumsumx + cumsumxl - 2*xy(1+lag)
cumsumx
cumsumxl
set threshold d
Definition: f0detectionyin.m:6
xy
for lag

Definition at line 14 of file f0detectionyin.m.

function maxf0

Definition at line 1 of file f0detectionyin.m.

compute lag corresponding to minf0 maxf0lag = 1+round(fs./maxf0)

Definition at line 27 of file f0detectionyin.m.

function minf0

Definition at line 1 of file f0detectionyin.m.

end limit the search to the target range minf0lag = 1+round(fs./minf0)

Definition at line 26 of file f0detectionyin.m.

compute lag corresponding to maxf0 if (maxf0lag>1 && maxf0lag<maxlag) d2(1 avoid lags shorter than maxf0lag end if (minf0lag>1 && minf0lag<maxlag) d2(minf0lag avoid lags larger than minf0lag end find the best candidate mloc = 1 + find((d2(2:end-1)<d2(3:end)).*(d2(2:end-1)<d2(1:end-2)))

Definition at line 35 of file f0detectionyin.m.

rval = d2(candf0lag+1)

Definition at line 50 of file f0detectionyin.m.

maximum lag th = 0.1

Definition at line 5 of file f0detectionyin.m.

val = d2(candf0lag)

Definition at line 49 of file f0detectionyin.m.

Definition at line 1 of file f0detectionyin.m.

xy = xcorr(x(1:ws*2),x1)

Definition at line 12 of file f0detectionyin.m.