Comments (7)
Nope, in fact, xtract_f0()
, xtract_failsafe_f0()
and xtract_wavelet_f0()
all take a block of audio samples, not the magnitude coefficients as input. I've found xtract_wavelet_f0()
to be the most reliable method.
from libxtract.
f0 works properly with the pcm data thanks to clarify this, I'll have a go witht the wavelet method too.
I reckon generally it would be good if the doc could specify the input type for each function, some of the functions already do it, some other are a bit more confusing.
thanks.
from libxtract.
none of the f0 functions work with frequencies below 100Hz, wavelet_f0 flicker between 0 and the frequency value(in this case 65Hz), is it a bug? they all work find with frequencies above 100Hz.
from libxtract.
Have you tried increasing the block size? The accuracy of F0 detectors is generally a function of block size, where larger block size means more accurate detection, and better ability to detect lower frequencies. To go below 100Hz, you probably need a blocksize of 2048. This isn't unique to LibXtract, you will find this issue with other pitch detectors also.
If you're worried about introducing latency, you could overlap blocks for the f0() functions.
from libxtract.
this is quite interesting, at the moment I'm using a blocksize of 1024 which also lead me to a question, does the Xtract blocksize has to match the input PCM sample count or can I just take half of it?
The blocksize from the Cinder audio pcm buffer is usually 2048, but the blocksize I'm using in libxtract is 1024, which means I only take the first 1024 values from the pcm buffer, is this a problem?
Also does the fft size need to be half of the blocksize or can it be anything power of 2?(128, 256 ..)
Going back to the issue above, using 2048 as blocksize is not ideal, in theory I want to use the smallest useful blocksize to boost the performance, can you please explain what you mean with overlapping blocks?
thanks.
from libxtract.
.. and one more question, how bad/inaccurate do you reckon is to cut off all the frequencies below 100Hz from the F0 functions?
Do you think this is an acceptable trade off or should I do something about?
from libxtract.
OK...
- You can use any block size
N
with most of the xtract functions.xtract_spectrum()
needs a power-of-two though - If you have an audio buffer of, say, 2048 samples, and you pass that buffer as
*data
to e.g.xtract_spectrum()
with anN
of 1024, you will get the spectrum of half of your audio block. Unless you have an overlapping scheme in place (see below) this is probably not what you want - The FFT size can technically be any power-of-two, however typically you will want to do something like:
double spectrum[BLOCKSIZE] = {0};
xtract_init_fft(BLOCKSIZE, XTRACT_SPECTRUM);
xtract[XTRACT_SPECTRUM](windowed, BLOCKSIZE, &argd[0], spectrum);
- Here
spectrum
will contain N/2 magnitude coefficients and N/2 frequencies - If you want to improve F0 resolution without compromising latency, you can use a blocksize of e.g. 1024 for all features except F0, for which you use 2048. For your very first block you don't compute F0 (or compute it with N=1024). For all consecutive blocks, you compute F0 using 2048 samples taken from the previous block + the current block. You therefore need to always retain the previous audio block for this purpose
Regarding the Cinder blocksize of 2048 — is there a way to adjust this? You aren't reducing latency by using 1024 for libxtract if you're getting blocks of 2048 samples from your audio callback, you're just missing data. Basically you need to find a way to reduce the Cinder blocksize.
from libxtract.
Related Issues (20)
- failing mingw64 compilation HOT 6
- no more pd externals? HOT 2
- Python bindings in 2019 HOT 2
- Failing to build HOT 5
- Wrong Spectrum Computation HOT 1
- Mel spectrograms
- Build error on Windows
- Remove printf logging
- xtract_loudness() sometimes gives too-high values
- Building Pure Data external HOT 1
- Python bindings not installed with build HOT 4
- issue of building python bindings HOT 2
- round-off errors in generating spectra and other parameters HOT 5
- fabs warnings HOT 1
- Reinstate Pd external using flext
- LibXtract integrated in Ios application:
- python bindings HOT 1
- pip or conda package for python
- error in wavefile.cpp cannot install
- No downloads/releases anymore? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxtract.