Changeset 58 for birds/specwhiten.m


Ignore:
Timestamp:
06/14/13 17:31:23 (11 years ago)
Author:
vcheplygina
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • birds/specwhiten.m

    r57 r58  
    33function s2 = whiten(s,fmax)
    44
    5 %Values output by spectrogram are already in [0, 1] range
     5%Not sure about this, but the paper seems to assume this
     6s = abs(s);
     7
     8%Values output by spectrogram are already in [0, 1] range?
     9
     10
    611
    712%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
     15s1 = s;             %Version for segmentation
    1016
    1117%For each frame, find a quantity similar to the energy"
     
    2127
    2228lowestix = find(energy<threshold);
    23 lowestenergy = energy(lowestix);
     29%lowestenergy = energy(lowestix);
    2430
    2531
     
    2733s2 = s1;
    2834for 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);
    3038    s2(f,:) = s1(f,:) ./P(f);
    3139end
Note: See TracChangeset for help on using the changeset viewer.