source: birds/domilbirds.m @ 54

Last change on this file since 54 was 54, checked in by vcheplygina, 11 years ago
File size: 836 bytes
Line 
1% directory where the WAV-files of the birds are stored:
2dpath = fullfile(mildatapath,'birds');
3
4fname = '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);
9fmax = 256;%Defined in paper
10
11figure(2); clf; showspec(S,f,t);
12[S,f,t] = spectrogram(signal,512,256,fmax,fs);
13
14figure(2); imagesc(t,f,abs(S));
15axis xy; xlabel('time (s)'); ylabel('freq.');
16
17figure(3); clf; showspec(imag(S), f,t);
18
19% smooth and threshold the spectrogram?
20G = fspecial('gaussian',[5 5],2); % window 5x5, sigma=2
21I = imfilter(abs(S),G,'same');
22t = dd_threshold(I(:),0.8);
23mask = (I>t);
24mask(f<2000,:) = 0;
25
26figure(4); clf; imagesc(mask); axis xy;
27
28
29
30%%
31s2 = whiten(S,fmax);
32figure(4); imagesc(t,f,s2);
33axis xy; xlabel('time (s)'); ylabel('freq.');
Note: See TracBrowser for help on using the repository browser.