FFmpeg
|
Go to the source code of this file.
Functions | |
if (zvalue==0)%avoid zero frequency peak pfreq(zindex) | |
pmag (zindex) | |
find peak with maximum magnitude | ival2 (Mloc1) |
find second maximum magnitude peak | ival2 (Mloc2) |
initialize array of candidates | f0c (1:nCand) |
candidates | f0c (nCand+1:nCand *2) |
f0c (nCand *2+1:nCand *3) | |
candidates within boundaries | if (isempty(f0c))%if no candidates exit f0=0 |
ErrorMP (i) | |
Variables | |
function [f0, f0error] | |
pmag | __pad5__ |
pmag | N |
pmag | minf0 |
pmag | maxf0 |
pmag | f0error =100 |
frequency in Hertz of | peaks [zvalue, zindex] = min(pfreq) |
end | ival2 = pmag |
clear max | peak [Mmag2, Mloc2] = max(ival2) |
find third maximum magnitude peak | nCand = 3 |
number of possible f0 candidates for each max peak | f0c = zeros(1,3*nCand) |
return end | harmonic = f0c |
ErrorPM = zeros(fliplr(size(harmonic))) | |
initialize PM errors | MaxNPM = min(10,length(ploc)) |
for | i |
difmatrixPM = abs(difmatrixPM-ones(fliplr(size(harmonic)))*pfreq') | |
Ponddif = FreqDistance .* (harmonic'.^(-0.5)) | |
PeakMag = pmag(peakloc) | |
MagFactor = 10.^((PeakMag-Mmag1)./20) | |
end | ErrorMP = zeros(fliplr(size(harmonic))) |
initialize MP errors | MaxNMP = min(10,length(pfreq)) |
nharm = (nharm>=1).*nharm + (nharm<1) | |
FreqDistance = abs(pfreq(1:MaxNMP) - nharm*f0c(i)) | |
end | Error = (ErrorPM/MaxNPM) + (0.3*ErrorMP/MaxNMP) |
total | errors [f0error, f0index] = min(Error) |
get the smallest error | f0 = f0c(f0index) |
Function Documentation
ErrorMP | ( | i | ) |
initialize array of candidates f0c | ( | 1:nCand | ) |
if | ( | zvalue | = =0 | ) |
|
pure virtual |
pmag | ( | zindex | ) |
Variable Documentation
pmag __pad5__ |
Definition at line 2 of file extra/TWM.m.
Definition at line 34 of file extra/TWM.m.
Definition at line 30 of file extra/TWM.m.
Definition at line 54 of file extra/TWM.m.
Referenced by parse_acl_row(), and parse_ffconfig().
Definition at line 55 of file extra/TWM.m.
Definition at line 20 of file extra/TWM.m.
f0error =100 |
Definition at line 2 of file extra/TWM.m.
Definition at line 2 of file extra/TWM.m.
harmonic = f0c |
Definition at line 29 of file extra/TWM.m.
for i |
Definition at line 32 of file extra/TWM.m.
Definition at line 13 of file extra/TWM.m.
MagFactor = 10.^((PeakMag-Mmag1)./20) |
Definition at line 38 of file extra/TWM.m.
pmag maxf0 |
Definition at line 2 of file extra/TWM.m.
Definition at line 43 of file extra/TWM.m.
pmag minf0 |
Definition at line 2 of file extra/TWM.m.
pmag N |
Definition at line 2 of file extra/TWM.m.
Definition at line 19 of file extra/TWM.m.
nharm = (nharm>=1).*nharm + (nharm<1) |
Definition at line 46 of file extra/TWM.m.
Definition at line 16 of file extra/TWM.m.
PeakMag = pmag(peakloc) |
Definition at line 37 of file extra/TWM.m.
Definition at line 8 of file extra/TWM.m.
Ponddif = FreqDistance .* (harmonic'.^(-0.5)) |
Definition at line 36 of file extra/TWM.m.
Generated on Fri Dec 20 2024 06:56:16 for FFmpeg by 1.8.11