Julia package for just a Short-Time Fourier Transform. https://docs.zymon.org/STFT.jl/
Find a file
2022-06-25 11:31:58 +02:00
docs documentation webpage init 2022-04-27 09:32:56 +02:00
src Minor fix for synthesis docs. 2022-05-11 14:12:58 +02:00
.gitignore init 2022-04-25 15:01:38 +02:00
LICENSE init 2022-04-25 15:01:38 +02:00
Project.toml Aliases for analysis and synthesis. 2022-05-10 17:34:51 +02:00
README.md README update 2022-06-25 11:31:58 +02:00

STFT.jl - Short-Time Fourier Transform

STFT.jl is a small Julia package implementing just Short-Time Fourier Transform (STFT) routines. It provides the following core functionality:

  • signal analysis; transform time-domain signal to STFT-domain signal.
  • signal synthesis; transform STFT-domain signal to time-domain signal.

Check the documentation for more insights.

Installation

The package is currently available in General, the default Julia package registry. To install this package from General registry, use the following command in Julia REPL:

] add STFT

Alternatively, directly via repository:

pkg> add https://github.com/s-zymon/STFT.jl

Examples

Below you can find a few standalone examples with basic usage of the package.

Show spectrogram

using STFT
using Plots

x = randn(10000)  # Generate mock signal
W = 64            # Window length
w = ones(W)       # Rectangular analysis window
H = 10            # Hop
L = W - H         # Overlap

X = stft(x, w, L)    # Analysis
s = abs2.(X)         # Compute spectrogram
heatmap(10log10.(s)) # Display spectrogram

Analyse signal, modify, and synthesise

using STFT

x = randn(10000)   # Generate mock signal
W = 64             # Window length
w = ones(W)        # Rectangular analysis window
H = 10             # Hop
L = W - H          # Overlap

X = stft(x, w, L)  # Analysis
X = f(X)           # Modify STFT-domain signal
y = istft(X, w, L) # Synthesis

Alternatively, instead of using STFT, you can import STFT, and use an alternative API, i.e., analysis and synthesis.

import STFT

x = randm(10000) # Generate mock signal
W = 64           # Window length
w = ones(W)      # Rectangular analysis window
H = 10           # Hop
L = W - H        # Overlap

X = STFT.analysis(x, w, L)  # Analysis
X = f(X)                    # Modify STFT-domain signal
y = STFT.synthesis(X, w, L) # Synthesis