Line | |
---|
1 | % directory where the WAV-files of the birds are stored: |
---|
2 | dpath = fullfile(mildatapath,'birds'); |
---|
3 | |
---|
4 | fname = 'PC13_20090531_050000_1.wav'; |
---|
5 | %fname = 'PC8_20090531_050000_99.wav'; |
---|
6 | [signal,fs] = wavread(fullfile(dpath,'wavs',fname)); |
---|
7 | |
---|
8 | [S,f,t] = spectrogram(signal,512,256,[],fs); |
---|
9 | |
---|
10 | figure(2); clf; showspec(S,f,t); |
---|
11 | figure(3); clf; showspec(imag(S), f,t); |
---|
12 | |
---|
13 | % smooth and threshold the spectrogram? |
---|
14 | G = fspecial('gaussian',[5 5],2); % window 5x5, sigma=2 |
---|
15 | I = imfilter(abs(S),G,'same'); |
---|
16 | t = dd_threshold(I(:),0.8); |
---|
17 | mask = (I>t); |
---|
18 | mask(f<2000,:) = 0; |
---|
19 | |
---|
20 | figure(4); clf; imagesc(mask); axis xy; |
---|
21 | |
---|
22 | |
---|
Note: See
TracBrowser
for help on using the repository browser.