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.
Your function is perfectly working thank you man, i have a question, i m a begginer in matlab and i want to extract the evolution of one harmonic component, i treied many ways but i can't do it, i will realy appreciate you r help & thank you again =).
Thanks a lot
thanks for your code
very helpful, I used this code in my project, thanks!
can someone point me to a java code for such an application?
its a good code for image processing.
e36 y tg
thanks a lot
thanks a lot! indeed very useful
thanks a lot .its very helpful!
It is very useful for a speech researcher.
very helpful thanks!
great...but why is the default fs=2?
Thanks! It's intuitive for me to learn how STFT works at the sense of programming in Matlab. Thank you!
it's useful for me!Thanks
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.
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)
a bit wordy, but looks better than matlab's default specgram, even with jet
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.