No BSD License  

4.22222

4.2 | 18 ratings Rate this file 69 Downloads (last 30 days) File Size: 3.82 KB File ID: #1553

Spectrogram (Short-time FT log magnitude)

by

 

26 Mar 2002 (Updated )

Computes the Short-time Fourier transform and displays as grayscale image or 3-D surface

| Watch this File

File Information
Description

This program is a modification and extension to Paul Kienzle's spectrogram program for Octave. It is for Matlab 6r12.1. The short-time fourier transform of a signal is computed by FFTs of overlapping windowed signal segments. You can then exit with the complete STFT, as a matrix, or you can go on to plot first a grayscale pseudocolor spectrogram with interpolated shading, and then a color 3-D surface spectrogram viewed from an optimum angle.
I made this because the specgram function in the Matlab toolbox is a joke, it doesn't even use a Fast Fourier Transform, electing to compute the DFT directly in its algorithm. Second, neither that algorithm nor Paul's original program used the pseudo plot, which allows interpolated shading of the colors, which makes the spectrogram look acceptable. The other way (i.e.\ Matlab SP toolbox, Paul's program) of displaying a 2-D plot with a third dimension as color is through an indexed image, but this doesn't allow interpolated shading, and so the spectrograms are totally useless for speech analysis.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (25)
25 Oct 2013 Ronny Meza

Thanks a lot

15 Dec 2011 zuo

thanks for your code

19 Jun 2010 Katarzyna Zarnowiec

very helpful, I used this code in my project, thanks!

26 Nov 2008 Mitko Orcev

can someone point me to a java code for such an application?

04 May 2008 muhammad rafiq

its a good code for image processing.

08 Apr 2008 Yuan-Tao Weng  
15 Mar 2008 ana sari  
15 Mar 2008 bouziane mohamed  
24 Dec 2007 venata subbu

e36 y tg

15 Dec 2007 sara wu

thanks a lot

06 Dec 2007 monoj sinha  
29 Sep 2007 Elena Subtirica

thanks a lot! indeed very useful

13 Aug 2007 ding pei

thanks a lot .its very helpful!

23 May 2007 Lifang Xue

It is very useful for a speech researcher.

22 May 2007 xuemin chi

very helpful thanks!

30 Apr 2007 sausage Li

great...but why is the default fs=2?

14 Jan 2007 Loong Zh

Thanks! It's intuitive for me to learn how STFT works at the sense of programming in Matlab. Thank you!

29 Mar 2006 Hoang Lan

it's useful for me!Thanks

03 Feb 2006 anitha padela  
28 Sep 2005 Aragon Burlingham  
12 Aug 2005 David Michael

Thanks for posting this. I was using MATLAB on a ssh cluster and was unable to get specgram or spectrogram to work properly. Apparently the built in function uses a MEX file and a FORTRAN file that it was unable to find while running on a remote machine. Your 3D graph is lovely. Thanks again.

29 Jul 2003 w w  
10 Jul 2003 Don Orofino

Have you tried "specgramdemo" shipping with the Signal Processing Toolbox? It provides an interactive GUI that might meet your need (including interactive colormap scaling ... it does not turn on "interpolated shading", however)

BTW, specgram does call FFT if frequency bins are equally spaced (which is the most typical usage)

14 Jun 2003 D.S. Peterson

a bit wordy, but looks better than matlab's default specgram, even with jet

22 May 2003 mohammed benbrahim  

Contact us