西安电子科技大学-信号与线性系统大作业-歌曲人声消除
- 简介
- 一、内容与要求
- 二、思路与方案
* - 2.1 立体声消除人声
– - 2.2 设计带阻滤波器消除人声
– - 三、成果及展示
* - 3.1 导入音频
- 3.2 左右声道相减,消去人声
- 3.3 使用带阻滤波器消去人声
- 3.4 最终效果
- 四、总结与感想
- 五、附录
简介
这篇文章的目的是为弟弟妹妹做大作业提供思路,学校作业可能会被复核,弟弟妹妹使用时一定要看一看,修改一下!
[En]
The purpose of this article is to provide ideas for younger brothers and sisters to do big homework, school homework may be double-checked, younger brothers and sisters must read it and revise it when using it!
如果你发现有什么不对劲的地方,你可以评论并留言。
[En]
If you find anything wrong, you can comment and leave a message.
代码和报告见我的GitHub找相应的课程,求个Star:XDU_HW,里面还有其他课程的代码和报告
一、内容与要求
本文通过对歌曲的立体声和过滤知识来实现对歌曲中人声的剔除,更好地保留背景音乐。利用设计的仿真程序对不同的歌曲进行测试,以验证和实现其可行性。
[En]
In this paper, through the song stereo and filtering knowledge to achieve the elimination of human voice in the song and better retain the background music. The design simulation program is used to test different songs, so as to verify and realize its feasibility.
二、思路与方案
2.1 立体声消除人声
2.1.1 基本原理
假设有两个信号
当我们分开听这两个信号时,我们听到的声音是完全相同的。当我们把这两个信号加在一起时,我们得到了一个新的音频信号。
[En]
When we listen to the two signals separately, the sound we hear is exactly the same. When we add these two signals together, we get a new audio signal.
你得到的只是一条幅度为零的直线,听不到任何声音。
[En]
All you get is a straight line with zero amplitude, and no sound can be heard.
2.1.2 通过左右两声道的音频消除人声
由2.1.1我们可以知道,两个振幅、频率完全相同的音频信号相位相差 时,人耳听到的两者声音没有区别,并且把这两个振幅、频率完全相同且相位相差 的两个音频信号相加后,声音被消除了,根据这个原理,我们可以消除歌曲中的人声。
对于一般的立体声歌曲,人们之所以能感受到立体声,是因为左右声道的伴奏频率、幅度、相位不同,而左右声道的人声基本相同。
[En]
For general stereo songs, the reason why people can feel stereo is that the accompaniment of the left and right channels is different in frequency, amplitude and phase, while the human voice is basically the same in the left and right channels.
假设人声信号为 ,左声道的伴奏为 ,右声道的伴奏为 ,则左右声道的音频分别为
从右声道中减去左声道得到新的左声道音频信号,从左声道中减去右声道得到新的右声道音频信号。
[En]
We subtract the left channel from the right channel to get a new left channel audio signal, and subtract the right channel from the left channel to get a new right channel audio signal.
对于单声道输出装置,新的左右声道的信号会相互抵消,所以使用单声道输出装置时,声音可以正常输出。
[En]
For the mono output device, the signals of the new left and right channels will cancel each other, so when the mono output device is used, the sound can be output normally.
2.2 设计带阻滤波器消除人声
2.2.3 基本原理
另一种消除声音的方法是使用带阻滤波器将音频信号在某一频率上的能量降为零,从而使原始信号中某一频率的声音消失。
[En]
Another way to eliminate sound is to reduce the energy of the audio signal at a certain frequency to zero using a band-stop filter, so that the sound of a certain frequency in the original signal disappears.
2.2.4 通过设计带阻滤波器消除歌曲中的人声
查阅数据后发现,男歌手的频率介于两者之间,而女歌手的频率则介于两者之间。我们可以设计两个带阻滤波器来滤除这两个频率范围内的音频信号,从而去除人声。
[En]
After consulting the data, the frequency of male singers is about between, while that of female singers is about between. We can design two band-stop filters to filter out the audio signals in these two frequency ranges to eliminate the human voice.
三、成果及展示
使用 设计仿真程序,完整代码见附录一。
3.1 导入音频
使用 中的 函数导入一段音频,并差分左右声道,分别进行离散傅里叶变换,得到的左右声道时域和频域的结果如下图所示。
; 3.2 左右声道相减,消去人声
首先从右声道中减去左声道得到新的左声道音频信号,然后从左声道中减去右声道得到新的右声道音频信号。新的左、右声道音频信号的时域和频域结果如下图所示。
[En]
First the left channel is subtracted from the right channel to get a new left channel audio signal, and then the right channel is subtracted from the left channel to get a new right channel audio signal. The time domain and frequency domain results of the new audio signals of the left and right channels are shown in the following figure.
3.3 使用带阻滤波器消去人声
使用 中的 函数设计两个 阶的带阻滤波器,信号的截至频率分别为 和 。再用 函数对最新得到的左右声道音频信号使用刚刚得到的带阻滤波器进行滤波,滤波后得到的最终左右声道时域和频域的结果如下图所示。
; 3.4 最终效果
运行程序消除了不同歌曲的人声,效果非常显著,人声几乎消失,达到了要求。
[En]
Run the program to eliminate the human voice of different songs, the effect is very significant, the human voice almost disappeared, meet the requirements.
四、总结与感想
本文采用左右声道相减和带阻滤波的方法去除歌曲中的人声,实现了达到实际应用的要求。
[En]
In this paper, the human voice in the song is eliminated by means of left and right channel subtraction and band-stop filter, and it is realized to achieve the requirements of practice.
通过这次练习,我对音频的原理和使用过滤器的经验有了更深的理解。通过将书本上的知识应用到实际问题中,我不仅对知识有了更深的理解。我对信号和线性系统的课程也更感兴趣。
[En]
Through this practice, I have a deeper understanding of the principle of audio and experience in the use of filters. By applying the knowledge in books to practical problems, I not only have a deeper understanding of knowledge. I also have a greater interest in the course of signals and linear systems.
五、附录
完整代码可以在歌曲人声消除MATLAB实现下载
Original: https://blog.csdn.net/m0_50827783/article/details/111406848
Author: CK1201
Title: 西安电子科技大学-信号与线性系统大作业-歌曲人声消除
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/525481/
转载文章受原作者版权保护。转载请注明原作者出处!