# S transform

S transform as a time–frequency distribution was developed in 1994 for analyzing geophysics data. In this way, the S transform is a generalization of the short-time Fourier transform (STFT), extending the continuous wavelet transform and overcoming some of its disadvantages. For one, modulation sinusoids are fixed with respect to the time axis; this localizes the scalable Gaussian window dilations and translations in S transform. Moreover, the S transform doesn't have a cross-term problem and yields a better signal clarity than Gabor transform. However, the S transform has its own disadvantages: the clarity is worse than Wigner distribution function and Cohen's class distribution function.
A fast S transform algorithm was invented in 2010. It reduces the computational complexity from O[N$^2$·log(N)] to O[N·log(N)] and makes the transform one-to-one, where the transform has the same number of points as the source signal or image, compared to storage complexity of N$^2$ for the original formulation. An implementation is available to the research community under an open source license.
A general formulation of the S transform makes clear the relationship to other time frequency transforms such as the Fourier, short time Fourier, and wavelet transforms.

## Definition

There are several ways to represent the idea of the S transform. In here, S transform is derived as the phase correction of the continuous wavelet transform with window being the Gaussian function.
* S-Transform
    $S_{x}(t,f)=\int _{-\infty }^{\infty }x(\tau )|f|e^{-\pi (t-\tau )^{2}f^{2}}e^{-j2\pi f\tau }\,d\tau$
* Inverse S-Transform
    $x(\tau )=\int _{-\infty }^{\infty }\left[\int _{-\infty }^{\infty }S_{x}(t,f)\,dt\right]\,e^{j2\pi f\tau }\,df$

## Modified form

* Spectrum Form
The above definition implies that the s-transform function can be expressed as the convolution of $(x(\tau )e^{-j2\pi f\tau })$ and $(|f|e^{-\pi t^{2}f^{2}})$. Applying the Fourier transform to both $(x(\tau )e^{-j2\pi f\tau })$ and $(|f|e^{-\pi t^{2}f^{2}})$ gives
    $S_{x}(t,f)=\int _{-\infty }^{\infty }X(f+\alpha )\,e^{-\pi \alpha ^{2}/f^{2}}\,e^{j2\pi \alpha t}\,d\alpha$.
* Discrete-time S-transform
From the spectrum form of S-transform, we can derive the discrete-time S-transform.
Let $t=n\Delta _{T}\,\,f=m\Delta _{F}\,\,\alpha =p\Delta _{F}$, where $\Delta _{T}$ is the sampling interval and $\Delta _{F}$ is the sampling frequency. The Discrete time S-transform can then be expressed as:
    $S_{x}(n\Delta _{T}\,,m\Delta _{F})=\sum _{p=0}^{N-1}X[(p+m)\,\Delta _{F}]\,e^{-\pi {\frac {p^{2}}{m^{2}}}}\,e^{\frac {j2pn}{N}}$

## Implementation of discrete-time S-transform

Below is the Pseudo code of the implementation.

## Comparison with other time–frequency analysis tools
### Comparison with Gabor transform

The only difference between the Gabor transform (GT) and the S transform is the window size. For GT, the windows size is a Gaussian function $(e^{-\pi (t-\tau )^{2}})$, meanwhile, the window function for S-Transform is a function of f. With a window function proportional to frequency, S Transform performs well in frequency domain analysis when the input frequency is low. When the input frequency is high, S-Transform has a better clarity in the time domain. As table below.
| Low-frequency | Bad clarity in time domain | Good clarity in frequency domain |
| High-frequency | Bad clarity in frequency domain | Good clarity in time domain |
This kind of property makes S-Transform a powerful tool to analyze sound because human is sensitive to low frequency part in a sound signal.

### Comparison with Wigner transform

The main problem with the Wigner Transform is the cross term, which stems from the auto-correlation function in the Wigner Transform function. This cross term may cause noise and distortions in signal analyses. S-transform analyses avoid this issue.

### Comparison with the short-time Fourier transform

We can compare the S transform and short-time Fourier transform (STFT). First, a high frequency signal, a low frequency signal, and a high frequency burst signal are used in the experiment to compare the performance. The S transform characteristic of frequency dependent resolution allows the detection of the high frequency burst. On the other hand, as the STFT consists of a constant window width, it leads to the result having poorer definition. In the second experiment, two more high frequency bursts are added to crossed chirps. In the result, all four frequencies were detected by the S transform. On the other hand, the two high frequencies bursts are not detected by STFT. The high frequencies bursts cross term caused STFT to have a single frequency at lower frequency.

## Applications

* Signal filterings
* Magnetic resonance imaging (MRI)
* Power system disturbance recognition
** S transform has been proven to be able to identify a few types of disturbances, like voltage sag, voltage swell, momentary interruption, and oscillatory transients.
** S transform also be applied for other types of disturbances such as notches, harmonics with sag and swells etc.
** S transform generates contours which are suitable for simple visual inspection. However, wavelet transform requires specific tools like standard multiresolution analysis.
* Geophysical signal analysis
** Reflection seismology
** Global seismology