File Exchange

image thumbnail

Stockwell Transform (S-Transform)

version (844 Bytes) by Baba Dash
The Stockwell Transform gives a full time-frequency or spatial-frequency decomposition of a signal


Updated 30 Jan 2015

View License

This code computes the Stockwell transform (S-Transform) of a one dimensional series without for loop, thereby making it computationally fast and simple. S-Transform was proposed in 1996. A nice tutorial on S-Transform can be found here:‎

Comments and Ratings (27)

give error

Jesus Eiras

That gives an error: Matrix dimensions must agree (line 42)

My vector is a one-dimensional complex timeseries of u and v velocities based on the concept of a rotary spectra, as Stockwell has done recently in his paper inertial oscillations in surface winds. When I use your function there is no x and y labels so I don't know which is negative. Is there any way to turn the x and y labels on? Can this function work for a complex timeseries?

@Ayush : This code seems to output a result which is the conjugate of the one outputted from the original Code by Robert Glenn Stockwell


may i know how do u plot the magnitude? i got a strange plot when using abs(ST)

hi Baba Dash.can you please provide email?i need to confirm few urgent things.Thank you.


Works great once, but you may need to transpose the input. The result is a large matrix that can easily over-run you RAM. I had to decimate() my input.

The output is complex, so to get the magnitude plot in the picture you'll need to take the mag() or abs() of the result.


gfjjjj bbbb

I want to know the parameters that affect the time-frequency resolution for S_transform.

Elsaeed Ali


Dear Mr

I want to draw the frequency spectrum of non stationary transient signal
Did S-transform can be effective in it?

marie vill

hello how can i extract satistatical parameteres from The ST matrix

why cant i find the code??

why cant i fond the code??




I don't get the same result as from the original Code by Robert Glenn Stockwell please correct the code accordingly.


no reference, and most importantly, no useful help or internal documentation.

Baba Dash

Praveen: The ST matrix is a matrix of complex numbers the magnitude and phase of which can be used as features. Other statistical parameters can also be considered depending on their necessity.


What kind of features can be extracted after getting the S-transform Matrix?

q 368

Thank you


Thank you Baba Dash, useful neat code!

good code
can u plz provide inverse of s-transform


Is there also a fast inverse S transform ?



Can this be extended to 2 dimensions?

How to use this code to simulate power signal generated by DFIG model in Simulink


The graphics is for visual demonstration of frequency decomposition only and has been borrowed from the following source:

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux