A simple and user-friendly MATLAB tool for computing the short-time Fourier transform (STFT) and the discrete Gabor transform (DGT). It is designed to be easy and fast for practical use.
The following features of DGTtool might be different from the other tools:
- Parameters are stored inside DGTtool object for user-friendliness.
- All pre-computation runs only once so that repeated computation of DGT/STFT is fast.
- Many computations run in parallel for all channels (for multi-channel signal).
- Perfect reconstruction is very easily realized.
- Number of frequency bins can be smaller than the window length.
- Dual and tight windows can be computed easily.
- Sparse time-frequency representation (reassigned spectrogram) is implemented.
- Phase visualization tool (plotPhase) is implemented.
- STFT/DGT can be written in an operator form.
Download DGTtool.m and place it in the Current Folder.
Create a DGTtool object
F by specifying its parameters.
F = DGTtool('windowShift',500,'windowLength',1500,'FFTnum',2000,'windowName','Blackman')
(Note: This step can be done without parameters:
F = DGTtool. Unspecified parameters are set to default values.)
Compute a spectrogram
X from a signal
X = F(x);
Compute the signal
x from its spectrogram
x = F.pinv(X);
Three visualization functions are implemented. A spectrogram is computed and plotted from a time-domain signal
x (and sampling frequency
F.plot(x,fs) F.plotPhase(x,fs) F.plotReassign(x,fs)
To check all functions in DGTtool, please read and run demo.m.
provide detailed usage.
Yatabe, Kohei. DGTtool. Zenodo, 2021, doi:10.5281/ZENODO.5010751.
Kohei Yatabe (2021). DGTtool (https://github.com/KoheiYatabe/DGTtool), GitHub.
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!