function calspec(varargin)
% CALSPEC Calibrated spectrogram
%  CALSPEC accepts the same input arguments as SPECGRAM (variable number of
%  arguments may be specified, too, just like SPECGRAM) and produces a 
%  calibrated spectrogram image in the current figure window. The time
%  axis is calibrated in seconds, and the frequency axis is calibrated in kHz.
%
%  Example:
%
%     fs=10e3;				  % 10kHz sampling frequency
%     t=0:1/fs:2;         % 2 second time vector
%     y=chirp(t,0,2,4e3); % Chirp signal (DC to 4kHz)
%     calspec(y,[],fs)    % Display the calibrated spectrogram

%  Created 1998 March 31
%  Ed.Doering@Rose-Hulman.Edu
%  Department of Electrical and Computer Engineering
%  Rose-Hulman Institute of Technology
%  Terre Haute, IN 47803-3999
%
%  Copyright (c) 1998 by Ed Doering.


[b,f,t]=specgram(varargin{:});
imagesc(t,f/1000,abs(b))
axis('xy')
xlabel('time (s)')
ylabel('frequency (kHz)')
