• Viernes 8 de Noviembre de 2024, 17:04

Autor Tema:  Entender funcion  (Leído 1110 veces)

patricia888

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
Entender funcion
« en: Martes 3 de Mayo de 2011, 14:44 »
0
Hola! tengo que entender esta funcion para poder pasarla a C++, alguien me podría ayudar a comprenderla??
Gracias, Un Saludo.
Patricia


function [L,S,T,maxes] = find_landmarks(D,SR,N)
% [L,S,T,maxes] = find_landmarks(D,SR,N)
% Make a set of spectral feature pair landmarks from some audio data
% D is an audio waveform at sampling rate SR
% L returns as a set of landmarks, as rows of a 4-column matrix
% {start-time-col start-freq-row end-freq-row delta-time}
% N is the target hashes-per-sec (approximately; default 5)
% S returns the filtered log-magnitude surface
% T returns the decaying threshold surface
% maxes returns a list of the actual time-frequency peaks extracted.
%
% REVISED VERSION FINDS PEAKS INCREMENTALLY IN TIME WITH DECAYING THRESHOLD
%
% 2008-12-13 Dan Ellis dpwe@ee.columbia.edu

if nargin < 2; E = 4; end

if length(E) == 1
W = 4*E;
E = exp(-0.5*[(-W:W)/E].^2);
end

X = locmax(X);
Y = 0*X;
lenx = length(X);
maxi = length(X) + length(E);
spos = 1+round((length(E)-1)/2);
for i = find(X>0)
EE = [zeros(1,i),E];
EE(maxi) = 0;
EE = EE(spos+(1:lenx));
Y = max(Y,X(i)*EE);
end