Stereo Sounds 立体声 for part2

本文介绍了立体声定位(panning)的基本原理,包括如何通过调整左右声道的相对强度来模拟声音的位置变化,以及如何利用三角函数进行精确计算。此外,文章还提到了在实际音乐制作中立体声定位的应用技巧。

Until now we have considered only monaural sounds, however the very same principles apply to stereophonic sounds. The advantage of stereo sound is that it allows a sound to be “positioned” from left to right. The human ear determines the position of a sound, in part, by the relative intensities of the sound in the left and right ears. Stereo sounds have two independent channels, one for each ear.

Pan是指左右声道的位置,不同的乐器在乐队中的声相摆位也是不同的,不是所有乐器都放在左右声道的中间,这在实际操作中就会慢慢总结出它的规律。 

The positioning of a sound in stereo is known as “panning” (the audio counterpart to the cinematographic term). Pan can be static, or it can change in different ways. Listen carefully to one of your favorite rock songs (it's easier using headphones). You will notice that, even if it was recorded in a studio, the pan is laid out as if it were on stage. You will likely hear the lead singer front and center (equal in both channels), a guitar moved to one side a bit and another guitar or bass moved in the other direction, or some similar stage configuration. The drumset is an interesting case, as individual drums may even have different pans. Pan is also put to artistic use in some songs. Sounds can sweep back and forth, or sounds that respond to each other can be placed on opposite sides. A famous example of the latter is the opera section of Queen's Bohemian Rhapsody.

It's tempting to think that we can move a sound by simply scaling each channel linearly. That is, if we want a sound that appears to be shifted to the left by 1/4 we can multiply the input sequency by 3/4 for the left channel and 1/4 for the right channel. However, this is not the case. The human ear doesn't perceive the amplitude directly, but rather the intensity (which is related to the square of the amplitude). In order to find a proper scaling, the sum of the squares of both sides must remain constant. Conveniently, we know the identity that:

sin^2(t) + cos^2(t) = 1

很容易认为我们可以移动声音通过简单地线性调节每个声道。也就是,如果我们想要一个声音左移1/4位置出现,我们可以对于左声道乘以输入序列3/4,并对右声道1/4。可是,情况并非如此。人的耳朵不是直接感知振幅,而是强度(和振幅的平方有关)。为了找出一个合适的调节,两边的平方和必须保持为常量。我们常知的恒等式:

sin^2(t) + cos^2(t) = 1

We consider t in the range [0,pi/2]. In this interval, sin(t) increases from 0 to 1 and cos(t) decrease from 1 to 0. Thus we can use one factor to scale each channel. Also, for simplification let us consider:

sin^2(u*pi/2) + cos^2(u*pi/2) = 1

我们考虑t[0,pi/2]。在这个间隔里,sin(t)01,cos(t) 10.因此我们可以使用一个因素来调节每个声道。为了简化让我们来考虑:

sin^2(u*pi/2) + cos^2(u*pi/2) = 1

In this form, we can simply work with u in the range [0,1]. Intuitively(直观地), we let 0 mean “all the way to the left”, 1 mean “all the way to the right”, and everything else is a floating point value inbetween determining how the sound is scaled in each channel. The sound in the left channel is scaled by cos(u*pi/2) and the right channel by sin(u*pi/2). Thus, to achieve the above example of moving a sound 1/4 to the left, we can use u = .25. The left channel contains the sound scaled by cos(.25*pi/2) = 0.9239, and the right channel by sin(.25*pi/2) = 0.3827.

在这个形式中,我们可以用u[0,1]的范围来简化工作。直观地,我们设0表示“左声道”,1表示“右声道”,其他的是一个在此之间的浮点数来决定如何在各声道间调节声音。在左声道的声音通过cos(u*pi/2)来调节以及右声道通过sin(u*pi/2)来调节。因此,要实现以上向左移动1/4声音例子,我们可以使用u=.25。左声道包含了通过cos(.25*pi/2) = 0.9239调节的声音,右声道则包含了通过sin(.25*pi/2) = 0.3827调节的声音。

Of course, to achieve truly real-sounding stereo effects, there are other factors to consider like change in delay times caused by moving the source, or changes in acoustical properties of the room based on the position of the sound. We will not consider such factors, but it is important to know of their existence. Students should take special note that the input of the pan calculation if a mono sequence, and that the operation transforms the mono signal into a stereo signal. This means that such a routine should return a new array, rather than modifying the source array.

当然,为了实现真正实际音响的立体声效果,还要考虑其他的因素如由移动声源产生的延迟时间的改变,或者是在房间中基于声音位置的声学性质的改变。我们将不会考虑这些因素,但是很重要要了解它们的存在。学生应该特别注意位置计算的输入是否为单声道学列,并且该操作将单声道信号转换为立体声信号。这意味着这样的程序应该返回一个新数组,而是修改源数组。

内容概要:本文系统介绍了算术优化算法(AOA)的基本原理、核心思想及Python实现方法,并通过图像分割的实际案例展示了其应用价值。AOA是一种基于种群的元启发式算法,其核心思想来源于四则运算,利用乘除运算进行全局勘探,加减运算进行局部开发,通过数学优化器加速函数(MOA)和数学优化概率(MOP)动态控制搜索过程,在全局探索与局部开发之间实现平衡。文章详细解析了算法的初始化、勘探与开发阶段的更新策略,并提供了完整的Python代码实现,结合Rastrigin函数进行测试验证。进一步地,以Flask框架搭建前后端分离系统,将AOA应用于图像分割任务,展示了其在实际工程中的可行性与高效性。最后,通过收敛速度、寻优精度等指标评估算法性能,并提出自适应参数调整、模型优化和并行计算等改进策略。; 适合人群:具备一定Python编程基础和优化算法基础知识的高校学生、科研人员及工程技术人员,尤其适合从事人工智能、图像处理、智能优化等领域的从业者;; 使用场景及目标:①理解元启发式算法的设计思想与实现机制;②掌握AOA在函数优化、图像分割等实际问题中的建模与求解方法;③学习如何将优化算法集成到Web系统中实现工程化应用;④为算法性能评估与改进提供实践参考; 阅读建议:建议读者结合代码逐行调试,深入理解算法流程中MOA与MOP的作用机制,尝试在不同测试函数上运行算法以观察性能差异,并可进一步扩展图像分割模块,引入更复杂的预处理或后处理技术以提升分割效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值