Created
January 29, 2014 02:00
-
-
Save abbiekressner/8680452 to your computer and use it in GitHub Desktop.
Wrapper to sync Matlab's spectrogram function with Octave's specgram function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function varargout = spectrogram (varargin) | |
% Matlab: [S,F,T]=spectrogram(x,window,noverlap,nfft,fs) | |
% Octave: [S [, f [, t]]] = specgram(x [, n [, Fs [, window [, overlap]]]]) | |
if nargin == 5 | |
[varargout{1:nargout}] = specgram (varargin{1},varargin{4},varargin{5},varargin{2},varargin{3}); | |
elseif nargin == 4 | |
[varargout{1:nargout}] = specgram (varargin{1},varargin{4},[],varargin{2},varargin{3}); | |
elseif nargin == 3 | |
[varargout{1:nargout}] = specgram (varargin{1},[],[],varargin{2},varargin{3}); | |
elseif nargin == 2 | |
[varargout{1:nargout}] = specgram (varargin{1},[],[],varargin{2},[]); | |
elseif nargin == 1 | |
[varargout{1:nargout}] = specgram (varargin{1},[],[],hamming(256),[]); | |
end | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment