https://github.com/s-zymon/stft.jl
Julia package for Short-Time Fourier Transform. It's a mirror just to carry out package registration in Julia's General registry.
https://github.com/s-zymon/stft.jl
julia signal-processing stft
Last synced: 4 months ago
JSON representation
Julia package for Short-Time Fourier Transform. It's a mirror just to carry out package registration in Julia's General registry.
- Host: GitHub
- URL: https://github.com/s-zymon/stft.jl
- Owner: s-zymon
- License: mit
- Created: 2022-04-25T12:58:57.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T15:31:45.000Z (about 1 year ago)
- Last Synced: 2025-10-21T13:02:36.408Z (8 months ago)
- Topics: julia, signal-processing, stft
- Language: Julia
- Homepage: https://codeberg.org/zymon/STFT.jl
- Size: 19.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `STFT.jl` - Short-Time Fourier Transform
[](https://docs.zymon.org/STFT.jl/)
`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](https://docs.zymon.org/STFT.jl/) 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:
```julia
] add STFT
```
Alternatively, directly via repository:
```julia
pkg> add https://codeberg.org/zymon/STFT.jl
```
## Examples
Below you can find a few standalone examples with basic usage of the package.
### Show spectrogram
```julia
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
```julia
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`.
```julia
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
```