%processgunndata.m % to process data collected from Gunn radar % 30 November 2006, Jim Lux % data is in a stereo wav file collected with a PC % we use the Matlab spectrogram to do the display [y,fs]=wavread('logfile2.wav'); % get data and sample rate yc=complex(y(:,1),y(:,2)); % turn into a complex vector wsize=1024;overlap=512;nfft=1024; spectrogram(yc,wsize,overlap,nfft,fs) colorbar % % look only at the bottom 1 kHz or so % yca=decimate(yc,10,'fir'); figure wsize=512;overlap=256;nfft=512; [yy,F,T,P]=spectrogram(yca,wsize,overlap,nfft,fs/10); % let's rearrange F and data to make positive and negative frequencies right XP=[P(nfft/2+1:nfft,:);P(1:nfft/2,:)]; XF=[-F(nfft/2:-1:2);F(1:nfft/2+1)]; surf(T,XF,10*log10(abs(XP)),'EdgeColor','none'); axis xy; axis tight; colormap(jet); view(0,90); xlabel('Time (secs)'); ylabel('Frequency (Hz)'); colorbar