Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: ieee.org -
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Keywords
Repository
Constant-Q Sliding DFT in C++, Rust and Python
Basic Info
Statistics
- Stars: 39
- Watchers: 3
- Forks: 3
- Open Issues: 7
- Releases: 1
Topics
Metadata Files
README.md
Constant-Q Sliding DFT in C++, Rust, and Python
Forward and inverse Constant-Q Sliding DFT (QDFT) according to [1] with following features:
- Arbitrary octave resolution (quarter tone by default)
- Built-in parameterizable cosine family window (Hann by default)
- Customizable time and frequency domain data type in C++
- Endless single or multiple sample processing at once
- Optional quality control parameter to smoothly reduce low frequency bandwidth and improve the time resolution
- Optional analysis latency control parameter
- Real-time analysis and synthesis capability
The Constant-Q Sliding Discrete Fourier Transform (QDFT) is a recursive approach to compute the Fourier transform sample by sample. This is an efficient implementation without the FFT calculus. Just define an arbitrary frequency range and octave resolution to obtain the corresponding DFT estimate. In contrast to the linear SDFT, frequency bins of the QDFT are logarithmically spaced. Thus, both high and low frequencies are resolved with the same quality, which is particularly useful for audio analysis. Based on the QDFT, a chromagram feature with detailed instantaneous frequency estimation is planned for the future release.
WIP
- [x] Readme
- [ ] Docstrings
- [x] PyPI package qdft
- [x] Rust package qdft
- [ ] Sliding chromagram as a bonus (a draft is already included in the Python package)
Basic usage
C++
```c++
include // see also cpp folder
double sr = 44100; // sample rate in hertz
std::pair
QDFT
sizet n = ...; // number of samples sizet m = qdft.size(); // number of dft bins
float* x = ...; // analysis samples of shape (n) float* y = ...; // synthesis samples of shape (n)
std::complex
qdft.qdft(n, x, dft); // extract dft matrix from input samples qdft.iqdft(n, dft, y); // synthesize output samples from dft matrix ```
The time domain data type defaults to float and the frequency domain data type to double.
Rust
```rust use qdft::QDFT; // see also rust folder
// just a shortcut for our complex number type
[allow(noncamelcase_types)]
type c64 = num::complex::Complex
// zero number trait, e.g. c64::zero() use num::Zero;
let samplerate = 44100.0; // sample rate in hertz let bandwidth = (50.0, samplerate / 2.0); // lowest and highest frequency in hertz to be resolved let resolution = 24.0; // octave resolution, e.g. number of DFT bins per octave let latency = 0.0; // analysis latency adjustment between -1 and +1 let window = Some((0.5, -0.5)); // hann window coeffs
// create qdft plan for custom time and frequency domain data types
let mut qdft = QDFT::
let n = ...; // number of samples let m = qdft.size(); // number of dft bins
let mut x = vec![f32::zero(); n]; // analysis samples of shape (n) let mut y = vec![f32::zero(); n]; // synthesis samples of shape (n)
let mut dft = vec![c64::zero(); n * m]; // dft matrix of shape (n, m)
qdft.qdft(&x, &mut dft); // extract dft matrix from input samples qdft.iqdft(&dft, &mut y); // synthesize output samples from dft matrix ```
Alternatively use ndarray instead of a flat array to allocate the DFT matrix, as shown in the analysis.rs example.
Python
```python from qdft import QDFT # see also python folder
sr = 44100 # sample rate in hertz bw = (50, sr / 2) # lowest and highest frequency in hertz to be resolved r = 24 # octave resolution, e.g. number of DFT bins per octave
qdft = QDFT(sr, bw, r) # create qdft plan
n = ... # number of samples m = qdft.size # number of dft bins (if need to know in advance)
x = ... # analysis samples of shape (n)
dft = qdft.qdft(x) # extract dft matrix of shape (n, m) from input samples y = qdft.iqdft(dft) # synthesize output samples from dft matrix ```
Feel free to obtain current version from PyPI by executing pip install qdft.
Examples
| QDFT | Chroma12 |
| :--: | :------: |
|
|
|
| face.py | cmajor.py |
|
|
|
See also
If you're interested in Sliding DFT with linear frequency resolution, don't forget to browse my jurihock/sdft project!
References
Russell Bradford et al. (2008). Sliding with a Constant Q. International Conference on Digital Audio Effects. https://www.dafx.de/paper-archive/2008/papers/dafx08_63.pdf
Russell Bradford et al. (2005). Sliding is Smoother Than Jumping. International Computer Music Conference Proceedings. http://hdl.handle.net/2027/spo.bbp2372.2005.086
Eric Jacobsen and Peter Kootsookos (2007). Fast, Accurate Frequency Estimators. IEEE Signal Processing Magazine. https://ieeexplore.ieee.org/document/4205098
License
github.com/jurihock/qdft is licensed under the terms of the MIT license. For details please refer to the accompanying LICENSE file distributed with it.
Owner
- Name: Jürgen Hock
- Login: jurihock
- Kind: user
- Location: Karlsruhe, Germany
- Company: Fraunhofer
- Repositories: 16
- Profile: https://github.com/jurihock
❤️ Open Source, DSP, Audio FX
Citation (CITATION.cff)
cff-version: 1.2.0
title: "Constant-Q Sliding DFT in C++ and Python (QDFT)"
authors:
- family-names: Hock
given-names: Juergen
url: https://github.com/jurihock/qdft
license: MIT
type: software
message: >-
If you use this software, please cite it
using the metadata from this file.
references:
- title: "Sliding with a Constant Q"
authors:
- family-names: Bradford
given-names: Russell
url: https://www.dafx.de/paper-archive/2008/papers/dafx08_63.pdf
type: article
- title: "Sliding is Smoother Than Jumping"
authors:
- family-names: Bradford
given-names: Russell
url: http://hdl.handle.net/2027/spo.bbp2372.2005.086
type: article
- title: "Fast, Accurate Frequency Estimators"
authors:
- family-names: Jacobsen
given-names: Eric
- family-names: Kootsookos
given-names: Peter
url: https://ieeexplore.ieee.org/document/4205098
doi: 10.1109/MSP.2007.361611
type: article
GitHub Events
Total
- Watch event: 7
- Fork event: 1
Last Year
- Watch event: 7
- Fork event: 1
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 75
- Total Committers: 2
- Avg Commits per committer: 37.5
- Development Distribution Score (DDS): 0.013
Top Committers
| Name | Commits | |
|---|---|---|
| Jürgen Hock | j****k@j****e | 74 |
| hk | j****k@i****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 10
- Total pull requests: 2
- Average time to close issues: 3 days
- Average time to close pull requests: about 8 hours
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 1.1
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- jurihock (7)
- TF3RDL (2)
Pull Request Authors
- stellarpower (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cargo 1,403 total
- pypi 31 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 6
- Total maintainers: 2
pypi.org: qdft
Constant-Q Sliding DFT
- Homepage: https://github.com/jurihock/qdft
- Documentation: https://qdft.readthedocs.io/
- License: MIT
-
Latest release: 0.5
published almost 3 years ago
Rankings
Maintainers (1)
crates.io: qdft
Constant-Q Sliding DFT
- Documentation: https://docs.rs/qdft/
- License: MIT
-
Latest release: 0.1.0
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- ndarray 0.15.* development
- ndarray-npy 0.8.* development
- num 0.4.*