5D Library › 节律声刺激、听觉稳态反应与双耳等时调制工程 · English

第四章 播放途径与门控波形

串音把双耳拍变成单耳拍

第一章说明,双耳拍要求左右两个音分别只到达各自的耳蜗。实际的播放途径总有串音:右耳的音以某个两耳间衰减(IA)漏进左耳。设漏入的振幅比为 a=10−IA/20a = 10^{-IA/20},左耳听到 cos⁡ωt+acos⁡(ω+Δω)t\cos\omega t + a\cos(\omega+\Delta\omega)t,其振幅包络在 1−a1-a 与 1+a1+a 之间起伏,因此单耳拍的振幅调制深度恰好是 aa,功率包络的深度为 2a/(1+a2)2a/(1+a^2)。

推导

# Chapter 4. p07: When does a binaural beat turn into a monaural one?
# If the right-ear tone reaches the left cochlea with amplitude ratio
# a = 10^(-IA / 20), where IA is the interaural attenuation in dB, the
# left ear hears cos(w t) + a cos((w + dw) t). Its amplitude envelope
# |1 + a exp(i dw t)| swings between 1 - a and 1 + a, so the monaural
# beat depth is exactly a, and the power envelope depth is
# 2a / (1 + a^2). The IA values below are typical orders of magnitude
# for each way of delivering sound, used for illustration only.
# The program also checks the formula against a direct computation of
# the envelope on a fine time grid.
import math

DEVICES = [
    ("insert earphones", 70.0),
    ("closed circumaural", 50.0),
    ("supra-aural on-ear", 40.0),
    ("open-back headphones", 25.0),
    ("bone conduction band", 5.0),
    ("stereo loudspeakers", 3.0),
]

def direct_depth(a, n=20000):
    env = [abs(1 + a * complex(math.cos(2 * math.pi * k / n),
                               math.sin(2 * math.pi * k / n)))
           for k in range(n)]
    return (max(env) - min(env)) / (max(env) + min(env))

if __name__ == "__main__":
    print("   route                     IA dB   leak a   amp depth"
          "   power depth")
    for name, ia in DEVICES:
        a = 10 ** (-ia / 20)
        print("   {:24s} {:6.0f} {:8.4f} {:10.4f} {:12.4f}".format(
            name, ia, a, a, 2 * a / (1 + a * a)))
    print("\n   check against direct envelope computation:")
    for a in (0.01, 0.1, 0.5):
        print("     a = {:4.2f}   formula {:.4f}   direct {:.4f}".format(
            a, a, direct_depth(a)))
    print("\nReading: through insert or closed headphones the leaked")
    print("beat is a fraction of a percent deep and the binaural")
    print("mechanism is all there is. A bone conduction band or a pair")
    print("of loudspeakers delivers both tones to both cochleae, so a")
    print("'binaural' track becomes an ordinary monaural beat of more")
    print("than half depth, which acoustically is close to an")
    print("isochronic tone. Whatever such a track does, it is not")
    print("doing it binaurally.")
#    route                     IA dB   leak a   amp depth   power depth
#    insert earphones             70   0.0003     0.0003       0.0006
#    closed circumaural           50   0.0032     0.0032       0.0063
#    supra-aural on-ear           40   0.0100     0.0100       0.0200
#    open-back headphones         25   0.0562     0.0562       0.1121
#    bone conduction band          5   0.5623     0.5623       0.8545
#    stereo loudspeakers           3   0.7079     0.7079       0.9432
#
#    check against direct envelope computation:
#      a = 0.01   formula 0.0100   direct 0.0100
#      a = 0.10   formula 0.1000   direct 0.1000
#      a = 0.50   formula 0.5000   direct 0.5000
#
# Reading: through insert or closed headphones the leaked
# beat is a fraction of a percent deep and the binaural
# mechanism is all there is. A bone conduction band or a pair
# of loudspeakers delivers both tones to both cochleae, so a
# 'binaural' track becomes an ordinary monaural beat of more
# than half depth, which acoustically is close to an
# isochronic tone. Whatever such a track does, it is not
# doing it binaurally.

各途径的 IA 取示意的量级。入耳式耳机漏入的单耳拍深度只有 0.0003,压耳式耳机为 0.0100,开放式耳机为 0.0562;在这些情形下,双耳机制是唯一的机制。骨传导耳机把振动同时传到两侧耳蜗,深度为 0.5623;立体声扬声器为 0.7079,功率包络深度达 0.9432。也就是说,用扬声器或骨传导播放的「双耳拍」,在声学上已经接近一个等时音。无论这样的音轨产生什么效果,它都不是以双耳方式产生的。程序还用直接计算的包络核对了公式,三个漏入比下结果一致。

等时音的门控

等时音以固定频率开关一个载波。开关的边沿可以是突变的方波,也可以用若干毫秒的升余弦斜坡平滑。突变的边沿会把一部分能量甩到离载波很远的频率上,听起来是每次开启时的一声「咔嗒」;斜坡会改变包络的形状,从而改变刺激频率处谱线的强弱,也改变波形的峰值因数。

推导

# Chapter 4. p08: Gating shape of an isochronic tone: clicks and peaks.
# An isochronic tone switches a 400 Hz carrier on and off at 10 Hz with
# a 50 % duty cycle. The gate edges can be abrupt (square), or ramped
# by raised-cosine edges of 5 ms or 20 ms; a sinusoidal amplitude
# modulation (m = 1) is the smoothest case. For one second at 8,192 Hz
# we report:
#   splatter: share of power more than 100 Hz away from the carrier,
#     heard as clicks; in dB relative to total power;
#   crest factor: peak over RMS amplitude, in dB;
#   rate line: power at carrier +/- 10 Hz relative to the carrier.
# Splatter below -120 dB is printed as -120 (numerical floor).
import cmath
import math

FS = N = 8192

def fft(x):
    n = len(x)
    a = list(x)
    j = 0
    for i in range(1, n):
        bit = n >> 1
        while j & bit:
            j ^= bit
            bit >>= 1
        j |= bit
        if i < j:
            a[i], a[j] = a[j], a[i]
    size = 2
    while size <= n:
        w = [cmath.exp(-2j * math.pi * k / size) for k in range(size // 2)]
        for s in range(0, n, size):
            for k in range(size // 2):
                u, v = a[s + k], a[s + k + size // 2] * w[k]
                a[s + k], a[s + k + size // 2] = u + v, u - v
        size *= 2
    return a

def gate(t, ramp):
    ph = (t * 10.0) % 1.0
    on = 0.5
    if ph >= on:
        return 0.0
    tt = ph / 10.0
    if ramp <= 0:
        return 1.0
    if tt < ramp:
        return 0.5 - 0.5 * math.cos(math.pi * tt / ramp)
    if tt > on / 10.0 - ramp:
        return 0.5 - 0.5 * math.cos(math.pi * (on / 10.0 - tt) / ramp)
    return 1.0

def measure(env):
    x = [e * math.cos(2 * math.pi * 400 * i / FS)
         for i, e in enumerate(env)]
    X = fft(x)
    p = [abs(v) ** 2 for v in X[:N // 2]]
    tot = sum(p)
    far = sum(v for k, v in enumerate(p) if abs(k - 400) > 100)
    rms = math.sqrt(sum(v * v for v in x) / N)
    crest = 20 * math.log10(max(abs(v) for v in x) / rms)
    side = 10 * math.log10((p[390] + p[410]) / 2 / p[400])
    return max(10 * math.log10(far / tot), -120.0), crest, side

if __name__ == "__main__":
    cases = [("square gate", [gate(i / FS, 0) for i in range(N)]),
             ("5 ms raised cosine", [gate(i / FS, 0.005)
                                     for i in range(N)]),
             ("20 ms raised cosine", [gate(i / FS, 0.020)
                                      for i in range(N)]),
             ("sinusoidal AM, m = 1",
              [0.5 + 0.5 * math.cos(2 * math.pi * 10 * i / FS)
               for i in range(N)])]
    print("   gate shape             splatter dB   crest dB   rate line dB")
    for name, env in cases:
        sp, cr, sd = measure(env)
        print("   {:22s} {:10.1f} {:10.2f} {:12.2f}".format(name, sp, cr, sd))
    print("\nReading: an abrupt gate throws about 2 % of the power far")
    print("from the carrier, heard as a click at every onset. A 20 ms")
    print("raised cosine pushes that below -48 dB and, at this duty")
    print("cycle, even strengthens the 10 Hz line relative to the")
    print("carrier. Sinusoidal modulation is the cleanest spectrum of")
    print("all but has the weakest rate line of the four.")
#    gate shape             splatter dB   crest dB   rate line dB
#    square gate                 -16.9       6.02        -3.92
#    5 ms raised cosine          -24.7       6.60        -3.14
#    20 ms raised cosine         -48.3       9.03        -1.65
#    sinusoidal AM, m = 1       -120.0       7.27        -6.02
#
# Reading: an abrupt gate throws about 2 % of the power far
# from the carrier, heard as a click at every onset. A 20 ms
# raised cosine pushes that below -48 dB and, at this duty
# cycle, even strengthens the 10 Hz line relative to the
# carrier. Sinusoidal modulation is the cleanest spectrum of
# all but has the weakest rate line of the four.

方波门控把约 2% 的功率(16.9 dB 以下)甩到离载波 100 Hz 以外;5 ms 的升余弦斜坡把这一比例压到 24.7 dB 以下,20 ms 的斜坡压到 48.3 dB 以下。在 50% 占空比下,20 ms 斜坡还使 10 Hz 谱线相对载波由 3.92 dB 以下提高到 1.65 dB 以下。正弦调幅的频谱最干净,但其节律谱线最弱,在载波以下 6.02 dB。峰值因数在 6.02 dB 至 9.03 dB 之间,正弦调幅为 7.27 dB;这决定了同样的平均响度下峰值有多高。

注

设计上的含义。 若要用等时音诱发稳态反应,几毫秒到二十毫秒的升余弦斜坡几乎没有代价,却能去掉咔嗒声。若要比较双耳拍与等时音,二者的载波、平均声级与节律谱线强度都应预先匹配,否则比较的是声学参数,而不是机制。

小结

播放途径决定了双耳拍是否还是双耳拍:只有串音很小的耳机能保留双耳机制,扬声器与骨传导把它变成单耳拍。等时音的门控应使用短的升余弦斜坡,比较不同刺激时应匹配节律谱线的强度。

Fan, Y. (2026). Rhythmic Acoustic Stimulation, Auditory Steady-State Responses and Modulation Signal Engineering: Binaural versus Isochronic Envelope Depth, 40-Hz Phase-Locking Bounds and Pink-Noise Spectral Masking [节律声刺激、听觉稳态反应与双耳等时调制工程] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090211 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).