
clear all

nfft = 2048 ;
ampthreshold = -40 ;
max_freq_plot = 1500 ;
render_method = 'color_2_dot' ;
fft_overlap = fix(nfft*0.9) ;

pathname = 'C:\Documents and Settings\Bruce Land\My Documents\Octave\reassigment\' ;

%fname = 'Porichthys_growl1_22_5.wav';
%fname= 'Opsanus_beta_1.wav' ;
fname = 'j_k_0421_growl_1.wav' ;

[y,Fs] = wavread([pathname,fname]);

%y = y(21000:31000,1);
%y = y(fix(.01*Fs):fix(0.7*Fs),1) ;

figure(1);clf;
specgram(y(:,1),nfft,Fs,[], fft_overlap);
colormap gray
set(gca,'ylim', [0 max_freq_plot])

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

%figure(3);clf;
%[X,F,T] = raspecgram(y(:,1), nfft, Fs, [], fft_overlap, ampthreshold, render_method);
%TT = 200 ;
%plot(F(:,TT),20*log10(X(:,TT)),'o-k');
%set(gca,'xlim', [0 max_freq_plot])

figure(4);clf;
specgram(y(:,1),nfft,Fs,[], fft_overlap);
colormap gray
set(gca,'ylim', [0 max_freq_plot])
hold on
render_method = 'fast_1_dot' ;
raspecgram(y(:,1), nfft, Fs, [], fft_overlap, ampthreshold, render_method);
set(gca,'ylim', [0 max_freq_plot])