当前位置:网站首页>使用互相关进行音频对齐
使用互相关进行音频对齐
2022-07-31 16:04:00 【非典型废言】
在计算一些音频指标如SNR的时候,我们需要音频信号与参考信号对齐,但有时候我们处理后的或者录制的音频并不是与参考信号对齐的,这就需要找到一种方法将它们对齐。
I. 互相关函数
音频对齐可以转化为时延估计问题,我们以前有介绍过使用GCC-PHAT进行时延估计,这里我们采用一种更为简单的方式进行估计——互相关函数。我们在语音信号时域分析介绍过自相关函数,类似的对于离散时域信号互相关函数的计算公式为:
我们知道在频域互相关中我们对广义互相关进行了一个加权,PHAT起到了白化的结果使得其互相关函数峰值更加明显,类似的可以对公式(1)进行类似的操作来使得峰值更为明显:
互相关的计算其实和互相关类似,我找了个视频来解释这个计算过程。
II. Praat
很多编程语言都封装好了互相关函数,这里我们使用一个语音分析领域常用的软件叫Praat。由于语音长度是有限的Praat在互相关函数上进行了适当的修改,简单来说互相关序列的开始时间将是f 的开始时间减去g 的结束时间,结束时间将是f的结束时间减去g的开始时间,即第一个采样的时间是f 的第一个样本减去g的最后一个样本,最后一个样本的时间将是f的最后一个样本减去g 的第一个样本,自相关序列的长度是f和g的样本数之和减1。
我们下面来看下效果,首先我们有两个音频,如下图所示,可以明显看到两个轨道上的音频有明显的延迟。
我们通过Praat计算出两个音频的时间延迟大约是1.284s。
我们把第二个轨道的音频提前1.284s。
得到的结果如下,看起来两段音频基本对齐了。
本文相关代码,在公众号语音算法组菜单栏点击Code获取。
参考文献:
[1]. http://paulbourke.net/miscellaneous/correlate/
[2]. UCBS, Digital Speech Process
[3]. http://www.dsg-bielefeld.de/dsg_wp/wp-content/uploads/2014/10/video_syncing_fun.pdf
[4]. https://www.fon.hum.uva.nl/praat/manual/Sounds__Cross-correlate___.html
边栏推荐
- 牛客 HJ17 坐标移动
- Qt practical cases (54) - using transparency QPixmap design pictures
- 上传图片-微信小程序(那些年的坑记录2022.4)
- Website vulnerability repair service provider's analysis of unauthorized vulnerability
- tensorflow2.0 cnn(layerwise)
- How does automated testing create business value?
- Delete the disk in good condition (recovery partition)
- 字符指针赋值[通俗易懂]
- C语言”三子棋“升级版(模式选择+AI下棋)
- After the form is submitted, the page does not jump [easy to understand]
猜你喜欢
LevelSequence源码分析
基于Redis(SETNX)实现分布式锁,案例:解决高并发下的订单超卖,秒杀
How C programs run 01 - the composition of ordinary executable files
11 pinia use
Foreign media right, apple on May be true in inventory
The use of border controls
"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)
WPF project - basic usage of controls entry, you must know XAML
.NET 20th Anniversary Interview - Zhang Shanyou: How .NET technology empowers and changes the world
6-22漏洞利用-postgresql数据库密码破解
随机推荐
How does automated testing create business value?
Handling write conflicts under multi-master replication (4) - multi-master replication topology
Browser's built-in color picker
Delete the disk in good condition (recovery partition)
The arm button controls the flashing of the led light (embedded button experiment report)
基于C语言的编译器设计与实现
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
Getting Started with TextBlock Control Basic Tools Usage, Get Started
jeecg主从数据库读写分离配置「建议收藏」
2020 WeChat applet decompilation tutorial (can applet decompile source code be used)
01 Encounter typescript, build environment
Use of radiobutton
[MySQL] Mysql paradigm and the role of foreign keys
[Meetup Preview] OpenMLDB+OneFlow: Link feature engineering to model training to accelerate machine learning model development
LevelSequence源码分析
SringMVC中个常见的几个问题
基于Redis(SETNX)实现分布式锁,案例:解决高并发下的订单超卖,秒杀
arm按键控制led灯闪烁(嵌入式按键实验报告)
Implementing click on the 3D model in RenderTexture in Unity
C language - function