function X = vaneck(data, fs, MyDelta,MyStartFreq,MyEndFreq) %dada = audio data %fs = sampling rate %MyDelta = number of samples to perform FFT on %MyStartFreq = starting frequency to match %MyEndFreq = Ending frequency to match %example %plot(vaneck(data, fs, 1000, 1450, 1550)) % use data from data % use a sampling rate of fs % 1000 samples defines 1 bit % count "on" if there is a sound starting at 1450hz and ending at 1550hz) i=1; %counter for sample # delta=MyDelta; %number of samples comprising one bit tmp = size(data); MySize = tmp(1); %size of the entire sample while( (delta*(i+1)) < MySize ) %loop for each sample until the end [A,B] = dtft( data( i*delta : (i+1)*delta ), 1/fs); %slice sample and perform dtft to get frequency ranges, store amplitude array in A, and frequency array in B tmp=ceil(size(B)/2); %j will store the index of the amplitude, start it halfway because we dont care about the negative mirror j=tmp(2); %j=1; tmp=size(B); MySizeB = tmp(2); while(jMyStartFreq) && (B(j)