
clear all

nfft = 2048 ;
ampthreshold = -30 ;
fft_overlap = fix(nfft*0.5);
render_method = 'fast_1_dot' ;

%pathname = 'C:\Documents and Settings\Bruce Land\My Documents\My Music\';
pathname = 'C:\Documents and Settings\Bruce Land\My Documents\Octave\RA\';
file='20071210T162338.daq';
yraw=daqread(file);
datainfo=daqread(file,'info');
Fs = datainfo.ObjInfo.SampleRate ;
%y = yraw(Fs*30:Fs*60) ;
y = yraw;
 [b,a] = butter(2, 100/(Fs/2),'high');
 y = filter(b,a,y);
% ys = y([1:2:end]) ;
% Fs = Fs/2 ;

figure(1);clf;
specgram(y,nfft,Fs);
%axis('auto')


%figure(2);clf;
%raspecgram(y,nfft,Fs,[], fft_overlap, ampthreshold, render_method);
%set(gca,'ylim',[0,Fs/2])

figure(3); clf;
[X,F,T] = raspecgram(y,nfft,Fs,[], fft_overlap, ampthreshold, render_method);
%bothIndex = find(1000<F & F<1250);
%plot(T(bothIndex), F(bothIndex), '.g')
hold on
maleIndex = find(500<F & F<600);
plot(T(maleIndex), 2*F(maleIndex), '.b', 'markersize', 1)
hold on
femaleIndex = find(300<F & F<450);
plot(T(femaleIndex), 3*F(femaleIndex), '.r', 'markersize', 1)




