Monday 7 June 2010

Synthesizing Rayleigh Duplex Theory

Using the binaural recording of a 1kHz source at 50 degrees from the dummy head, ITDs and ILDs were extracted from the waveform in audacity and synthesized using Csound.

Below is the waveform of a 1kHz pure tone recorded by the binaural system that used to interpret ILDs and ITDs. The ITD is shown clearly by the shaded area, it extends from the peak in the left channel, to the peak in the right channel that corresponds to the same peak of the original source. Due to the greater path difference that sound has to travel to reach the ear that is further from the source, a delay is created. This delay is then used in Csound between two separate channels to synthesize this effect.

The ILD is achieved in csound by setting the amplitude of the two channels at the same difference ratio as the binaural recording.




The programs used:

; 1000 Hz 50 degree ITD frequency tone
;ITD 50 degrees 1000Hz tone.orc
; Hz sine wave at amplitude 10000

sr = 44100
kr = 11025
ksmps = 4
nchnls = 2

instr 1
idur = p3
a1 oscil 10000,1000,1
krat linseg 0, 0.0000001,1
outs a1*krat,a1*(1-krat)
endin

instr 2
idur = p3
a2 oscil 6000,1000,1
krat linseg 0, 0.0000001,1
outs a2*(1-krat), a2*krat


endin

Score File

;Score file
;ITD 50 degrees 1000Hz tone.sco

f1 0 4096 10 1 ; use gen 10 to compute a sine wave
i1 0 5 ; play instr 1 for 5 secs starting at 0
i2 0.000494 5.000494 play instr 2 for 5 secs starting at 0.494ms
e ; end of score





The pictures above show the synthesized waveform recreated from the ITD and ILD of an 1kHz tone at 50 degrees from the listener.

The sound can be found in 'my videos' link on my home page.

No comments:

Post a Comment