Changeset 58 for birds/specwhiten.m
- Timestamp:
- 06/14/13 17:31:23 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
birds/specwhiten.m
r57 r58 3 3 function s2 = whiten(s,fmax) 4 4 5 %Values output by spectrogram are already in [0, 1] range 5 %Not sure about this, but the paper seems to assume this 6 s = abs(s); 7 8 %Values output by spectrogram are already in [0, 1] range? 9 10 6 11 7 12 %Square root of spectrogram (of the absolute value?) 8 s1 = sqrt(abs(s)); 9 %s1 = sqrt(s); 13 14 %s1 = sqrt(abs(s)); %Version 1 15 s1 = s; %Version for segmentation 10 16 11 17 %For each frame, find a quantity similar to the energy" … … 21 27 22 28 lowestix = find(energy<threshold); 23 lowestenergy = energy(lowestix);29 %lowestenergy = energy(lowestix); 24 30 25 31 … … 27 33 s2 = s1; 28 34 for f=1:Nf 29 P(f) = sqrt(eps + sum(s1(f,lowestix).^2)); 35 %P(f) = sqrt(eps + sum(s1(f,lowestix).^2)); 36 37 P(f) = sum(s1(f,lowestix)) / length(lowestix); 30 38 s2(f,:) = s1(f,:) ./P(f); 31 39 end
Note: See TracChangeset
for help on using the changeset viewer.