简体   繁体   English

YIN频率检测和泛音(吉他弦)

[英]YIN-Frequency-Detection and overtones (guitar strings)

I'm developing an IOS app for frequency detection, and I'm using the YIN algorithm, which is very precise: witch Audacity, I've generated rectangular waves of different frequencies - and my algorithm has a precision of about 0.1 % - for example generating a tone of 82,4 Hz (E string), I really get 82,4 Hz and nothing else. 我正在开发用于频率检测的IOS应用程序,并且使用的是非常精确的YIN算法:女巫Audacity,我生成了不同频率的矩形波-我的算法的精度约为0.1%-例如,产生一个82.4 Hz的音调(E弦),我的确得到82.4 Hz,除此之外没有别的。

Anyhow, when I strum a guitar string, I often get overtones which sometimes can be stronger (with a higher amplitude) than the fundamental tone (F0). 无论如何,当我弹吉他弦时,我常常会得到泛音,有时它会比基音(F0)更强(幅度更高)。 Consequently, my display starts "dancing" and toggling - sometimes, it even occurs that (when the tone dies out) my algorithm stops at the overtone's frequency (for example A instead of E) - so the user has to strum the string again in oder to see if his desired tone (frequency) is present. 因此,我的显示开始“跳舞”并切换-有时甚至发生(当音调消失时)我的算法以泛音的频率停止(例如A而不是E)-因此用户必须再次将弦看看是否存在他想要的音调(频率)。

I know that this phenomena has nothing to do with my algorithm, because it's merely a "hardware" problem (I mean the guitar which simply produces overtones). 我知道这种现象与我的算法无关,因为这只是一个“硬件”问题(我的意思是吉他只会产生泛音)。

I've tried in vain to smooth the results (of the frequency detection) or to "snap" to a fixed frequency as soon as a crucial frequency (for example 82.4 Hz for E string +/- tolerance) has been detected. 我一味地尝试平滑结果(频率检测)或在检测到关键频率(例如对于E串+/-公差为82.4 Hz)后立即“捕捉”到固定频率是徒劳的。 Anyhow, it often occurrs that my algorithm snaps into an erroneous frequency, as well. 无论如何,我的算法也经常出现错误频率的情况。

I'm asking myself how cheap guitar tuners (for 10$ in guitar stores) are working, as their frequency detections are reliable and stable, as well. 我问自己一个问题:廉价的吉他调音器(在吉他商店中售价10美元)如何工作,因为它们的频率检测也可靠且稳定。

I don't want to change the algorithm, but two possible solutions come into my mind: 我不想更改算法,但是我想到了两种可能的解决方案:

  1. Preprocessing of the signal (maybe Hanning window, lowpass or bandpass filtering) and/or 信号的预处理(可能是汉宁窗口,低通或带通滤波)和/或
  2. Postprocessing of the signal (some kind of frequency smoothing). 信号的后处理(某种频率平滑)。

Has someone an idea how to overcome the "choppy" results? 有人知道如何克服“波涛汹涌”的结果吗?

I used autocorrelation for my free chromatic app iTransposer and incorporated a Hanning window so this may help you. 我为我的自由彩色应用程序iTransposer使用了自相关,并合并了Hanning窗口,因此这可能对您有所帮助。 I wasn't looking for accuracy initially as I wanted to display the note on a stave not a meter. 最初,我不是在寻找准确性,因为我想在音阶上显示音符而不是在仪表上。 However a friend of mine tested it to 0.1 Hz with a signal generator at his work and had issues over 383 Hz with simple signals such as Sine waves.I've tried it with various brass instruments, guitar and Garageband instruments seems to be OK for tuning. 但是我的一个朋友在他的工作中使用信号发生器将其测试到0.1 Hz,并且在诸如正弦波之类的简单信号上出现了383 Hz以上的问题。我已经尝试了各种铜管乐器,吉他和Garageband乐器调整。 Basically I implemented this http://www.ucl.ac.uk/~ucjt465/tutorials/praatpitch.html using VDSP and updated a sample project supplied by Kevin P Murphy https://github.com/kevmdev/PitchDetectorExample 基本上,我使用VDSP实现了http://www.ucl.ac.uk/~ucjt465/tutorials/praatpitch.html并更新了Kevin P Murphy提供的示例项目https://github.com/kevmdev/PitchDetectorExample

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM