For those using MATLAB interface to Madagascar, a new function, m8r, allows running Madagascar programs and workflows directly on MATLAB objects. The following MATLAB code runs regularized time-frequency analysis using sftimefreq:

% create chirp signal
t=0:0.001:1;
y=chirp(t,100,1,25,'q',[],'convex');

% spectragram analysis in MATLAB
spectrogram(y,256,200,256,1000);
set(gca,'xlim',[0,250]);
set(gca,'ydir','reverse');
ylabel('Time (s)');

% time-frequency analysis in Madagascar
tf = m8r('sftimefreq rect=50 nw=251 dw=1',y',0.001);

f = 0:250;
imagesc(t,f,tf);
xlabel('Frequency (Hz)');
ylabel('Time (s)');