Changeset 58 for birds


Ignore:
Timestamp:
06/14/13 17:31:23 (12 years ago)
Author:
vcheplygina
Message:
 
Location:
birds
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • birds/domilbirds.m

    r57 r58  
    1717figure(3); clf; showspec(imag(S), f,t);
    1818
     19%%
    1920% smooth and threshold the spectrogram?
    2021G = fspecial('gaussian',[5 5],2); % window 5x5, sigma=2
     
    3334%%
    3435s2 = specwhiten(S,fmax);
    35 figure(4); imagesc(t,f,s2);
     36figure(5); imagesc(t,f,s2);
    3637axis xy; xlabel('time (s)'); ylabel('freq.');
     38
     39% smooth and threshold the spectrogram?
     40G = fspecial('gaussian',[5 5],2); % window 5x5, sigma=2
     41I = imfilter(abs(s2),G,'same');
     42t = dd_threshold(I(:),0.95);
     43mask = (I>t);
     44mask(f<2000,:) = 0;
     45
     46figure(6); clf; imagesc(mask); axis xy;    %Ja, dit ziet er vergelijkbaar uit, iets minder kleine blobs aanwezig geloof ik?
     47% measure something:
     48x = regionprops(bwlabel(mask),abs(s2));
     49y = x([x.Area]>10)
     50
  • 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.