两个音频信号之间的时间延迟估计 [英] Time delay estimation between two audio signals

查看:54
本文介绍了两个音频信号之间的时间延迟估计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用两个不同的麦克风(例如,WAV格式)录制了两个相同信号的音频记录,但是其中一个被延迟录制了,例如几秒钟.

I have two audio recordings of a same signal by 2 different microphones (for example, in a WAV format), but one of them is recorded with delay, for example, several seconds.

在某种波形查看器中查看这些信号时,很容易在视觉上识别出这样的延迟-即仅在每个信号中发现第一个可见峰,并确保它们具有相同的形状:

It's easy to identify such a delay visually when viewing these signals in some kind of waveform viewer - i.e. just spotting first visible peak in every signal and ensuring that they're the same shape:


(来源: greycat.ru )

但是我该如何以编程方式进行操作-找出此延迟(t)是多少?两个数字化信号略有不同(因为麦克风不同,由于ADC设置等原因,麦克风的位置不同).

But how do I do it programmatically - find out what this delay (t) is? Two digitized signals are slightly different (because microphones are different, were at different positions, due to ADC setups, etc).

我仔细研究了一下,发现这个问题通常称为时间延迟估计",并且它有无数种解决方法-例如,

I've digged around a bit and found out that this problem is usually called "time-delay estimation" and it has myriads of approaches to it - for example, one of them.

但是是否有任何简单且现成的解决方案,例如命令行实用程序,库或直接算法?

But are there any simple and ready-made solutions, such as command-line utility, library or straight-forward algorithm available?

结论:我发现没有简单的实现,并且自己做了一个简单的命令行实用程序-在 https://bitbucket.org/GreyCat/calc-sound-delay (GPLv3许可).它实现了一个非常简单的最大搜索算法,该算法在 Wikipedia 中进行了描述.

Conclusion: I've found no simple implementation and done a simple command-line utility myself - available at https://bitbucket.org/GreyCat/calc-sound-delay (GPLv3-licensed). It implements a very simple search-for-maximum algorithm described at Wikipedia.

推荐答案

您正在寻找的技术称为

The technique you're looking for is called cross correlation. It's a very simple, if somewhat compute intensive technique which can be used for solving various problems, including measuring the time difference (aka lag) between two similar signals (the signals do not need to be identical).

如果您对滞后值(或至少是预期的滞后值范围)有一个合理的了解,则可以大大减少计算总量.同上,如果您可以对所需的精度进行明确的限制.

If you have a reasonable idea of your lag value (or at least the range of lag values that are expected) then you can reduce the total amount of computation considerably. Ditto if you can put a definite limit on how much accuracy you need.

这篇关于两个音频信号之间的时间延迟估计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆