Hot answers tagged

10

I've never seen the word "Formula" with "AMDF". My understanding of the definition of AMDF is $$ Q_x[k,n_0] \triangleq \frac{1}{N} \sum\limits_{n=0}^{N-1} \Big| x[n+n_0] - x[n+n_0+k] \Big| $$ $n_0$ is the neighborhood of interest in $x[n]$. Note that you are summing up only non-negative terms. So $Q_x[k,n_0] \ge 0$. We call "$k$" the "lag". clearly if ...


10

This is what we call in the pitch-detection biz, the "octave problem". First of all, I would change the AMDF to ASDF. And I would not reduce the window size as the lag increases. (Also, I am changing notation to what I consider to be more conventional. "$x[n]$" is a discrete-time signal.) The Average Squared Difference Function (ASDF) ...


9

"Is there a way to measure frequency (detect pitch) better than FFT, that is, with better resolution in less acquisition time?" yes there is. or are. there are multiple better ways to do musical pitch detection in real time that are far, far better than running an FFT. consider : Average Magnitude Difference Function (AMDF) $$ Q_x[k] = \sum_n |x[n] - ...


7

From the ones I've been using I can recommend: YAAFE - very pleasant to work with in Python ESSENTIA - another one I like particularly due to Python integration aubio FEAPI Aquila - friend of mine used it extensively and he likes it a lot Recently I came across this paper and I believe that this should perfectly answer your question. Moffat D. et al - ...


7

Cons: Not as accurate This is just compared to the other methods. I was measuring frequency very accurately to look for clock drift, etc: 1000.000004 Hz for 1000 Hz, for instance. For guitar pitch detection it will be fine. doesn't work for inharmonic things like musical instruments I should have said "it can't find an accurate fundamental if there is ...


6

This question (about "time-scaling" audio) is closely related to pitch shifting, which is time-scaling combined with resampling. But changing the speed without changing pitch is only time-scaling, so there is no resampling involved (contrary to what thomas has suggested). There are frequency-domain methods (phase-vocoder and sinusoidal modeling) that can ...


5

I have tried the following: Launch Audacity. Generate a 15000 Hz tone in the track created by default. Add a new track. Generate a 15400 Hz tone in the new track. A lower frequency tone appears during playback. The reason is that both tracks have high levels, so their sum exceeds 1.0; and Audacity applies clipping or limiting. This non-linear operation is ...


5

The two concepts are related to two different dimensions or aspects of music which might or might not be correlated. Onset detection is concerned with finding the points in time at which sounds start. Doing this does not require prior knowledge of the particular pitch (or fundamental frequency) of the sound. It may indeed rely on the property that at the ...


5

They may be referring to patent US3800088 by Harald Bode. I have a bunch of images from 15 years ago to explain a way to do frequency shifting so that it has the best chance of sounding good. I would call it single-sideband frequency shifting. Here the range of possible frequencies in the signal are drawn as two arrows each spanning half the circumference ...


5

When I play A3 (220Hz) in my guitar, the fifth string which is A2 (110Hz) also vibrates a bit: it is what is called Sympathetic resonance. Besides other non-linear effects, this could be the case. This phenomenon also occurs sometimes when recording bat calls, you can observe resonance at half the fundamental frequency. Here, the fundamental frequency is ...


4

Cepstrum argument is called quefreency, which is in fact a time domain. So for example if you are looking for the fundamental frequency then you are searching for a peak in a specific range. In your case that's $[0.002; 0.2] \;sec$, which corresponds to $[50; 500] \; Hz$., knowing that $f=\dfrac{1}{t}$. So when you are searching for fundamental frequency, ...


4

Audiophiles don't hear anything unless they are told what to expect. Joke aside, this is equivalent to transposition by a bit less than a semitone. The effect won't be noticed on voices - this is way too low for any kind "chipmunk" effect to be observed. As for music, some people very familiar with the original music might detect the change of tonality and/...


4

Check out chapter 1.3 of this IRCAM paper on multi-F0 estimation. It discusses the difficulties in extracting multiple F0s from a recording, including the handling of overlapping partials, transients, and reverberation, as well as the modeling of domain-specific sources with varied spectral properties.


4

OK I did the two some time ago, TDHS in principle just apply time scale modification and to change the pitch do you need apply interpolation (resample) and it will shift the spectral envelope. For TDHS is hard to find some paper that teach how its really works, I learned the math and how it works in the Burazerovic Dzevdet paper: $N_p$ is defined as the ...


4

Because guitar strings have non-zero stiffness, non-zero diameter, and non-zero displacement, the physical vibration frequency of the string's overtones can be slightly sharp. Thus inharmonic. But this slight inharmonicity might be part of what makes certain real stringed instruments sound more "interesting" than some simplistic additive and waveform ...


4

Here is roughly how it works. A typically musical note is made out of harmonics and the fundamental. The fundamental is also the spacing between the harmonics. For 100 Hz fundamental you would get 100Hz, 200Hz, 300Hz, 400Hz, 500 Hz, etc. For 200 Hz you would get 200Hz, 400Hz, 600 Hz, which is simlar to 100Hz but not the same. Note that specifically 300Hz ...


4

Sample playback The basic idea of sample playback in musical applications is to keep track of each voice's playback position, to form an output sample by reading the source sample data at the playback position, to add a possibly time-varying playback step to the playback position, and to repeat this in a program loop until we have accumulated enough output ...


4

The f[i] * i together determine the phase and frequency at every i so sine wave is only rendered correctly if there is no speed change, so the algorithm must be changed to allow for continuous time i and any change in frequency must not cause a phase jump. So try a phase accumulator approach, where phase for each i is incremented as required by the frequency....


3

Usually, the envelope of a note will decay. A new note pluck will start (add or replace) a new amplitude envelope with an attack transient. So you might add envelope tracking to your spectral frequency analysis (which may or may not be appropriate for correct pitch estimation).


3

As @jan pointed out, you're probably asking for a little too much, especially if you're looking for a ready implementation. Doing a quick search on Google, I came across several papers that may be a helpful start. In this paper called Multi-pitch Detection Algorithm Using Constrained Gaussian Mixture, the authors use the Expectation Maximization algorithm ...


3

If you are not doing this in low-latency real-time, you can work backwards from the stable portion of the pitch estimate to the transient attack portion of the waveform at the beginning. The sound of a plucked guitar string evolves in a possibly predictable pattern over time (e.g. more so than voice). If you can estimate the onset time and/or have ...


3

so Adamski, what you have here is what we call "the Octave Problem" and is well-known and oft discussed with people who work on the pitch detection problem. first, some definitions. given a quasi-periodic signal, $x(t)$, where $$ x(t) \approx x(t+T) $$ in some local region where $t \approx t_0$, we normally define "pitch", measured in octaves as the base-...


3

There is no easy answer to that question. Plenty of algorithms exists which are suitable to that task. Nowadays Non-negative Matrix Factorisation (NMF) is getting more and more popular in this field of research. If you have enough of resources and knowledge then you can try it. It's just a 'fancy' SVD decomposition with some 'constraints and tweaks'. Some ...


3

I realized I had forgotten to make an update to this. I ended up following @robert bristow-johnson's recommendations in the comments. I used time-domain McLeod Pitch Method in a live application (records audio in a loop) which works very well. You can see the source code here: https://github.com/sevagh/Pitcha


3

I already answered your question here: https://stackoverflow.com/questions/33667275/fast-frequency-measurement/33678202#33678202 But, in summary, in certain circumstances, you can interpolate an FFT result to finer resolution that FFT bin spacing, thus allowing you to use a shorter data window for better time resolution. But FFT frequency is not pitch ...


3

Thanks for citing my blog article on frequency calculation. Based on your emphasis on efficiency I am going to recommend a different approach which should get you equivalent or superior results with way fewer calculations. The first thing you should do is smooth your signal heavily with exponential smoothing. This will squash your harmonics and mitigate ...


3

Frequency is mathematically defined as the number of cycles per second. So it is a more strict word mathematically. It is represented numerically by the unit called Hertz. $f=1/T$, where $T$ represents the one-period length of a waveform. This makes frequency quantifiable. Pitch on the other hand, is a perceptual characteristic of a sound frequency, so it'...


3

The pitch period of a perfectly periodic function, $x(t)$, is the smallest positive value $P>0$ such that $$ x(t+P) = x(t) \qquad \forall t \in \mathbb{R} $$ Now, simply because a function is periodic with period $P$, then it is also periodic with periods $2P$ or $3P$ or $4P$ or any integer multiple of $P$, but we don't pick $2P$ or $3P$ or $4P$ for the ...


2

$g(\tau,m)$ is the weighting function used in the paper. Equation (7) tells you how to calculate its value. $\tau$ is the fundamental period which is the reciprocal of the fundamental frequency, $f_0$. If the fundamental frequency is 440 Hz then $\tau$ is $1/440 = 2.27$ ms.


2

Using the standard deviation of time lags is not a bad idea - the problem is that for very noisy signals such as consonants you won't really get a pattern with peaks. Your suggestion would be more useful in the context of musical instruments sound (for example to measure the inharmonicity of a sound, from violin to piano to bell...) You can look at the ...


Only top voted, non community-wiki answers of a minimum length are eligible