Shortcuts

asteroid.dsp.spatial module

asteroid.dsp.spatial.xcorr(inp, ref, normalized=True, eps=1e-08)[source]

Multi-channel cross correlation.

The two signals can have different lengths but the input signal should be shorter than the reference signal.

Note

The cross correlation is computed between each pair of microphone channels and not between all possible pairs e.g. if both input and ref have shape (1, 2, 100) the output will be (1, 2, 1) the first element is the xcorr between the first mic channel of input and the first mic channel of ref. If either input and ref have only one channel e.g. input: (1, 3, 100) and ref: (1, 1, 100) then output will be (1, 3, 1) as ref will be broadcasted to have same shape as input.

Parameters:
  • inp (torch.Tensor) – multi-channel input signal. Shape: \((batch, mic\_channels, seq\_len)\).
  • ref (torch.Tensor) – multi-channel reference signal. Shape: \((batch, mic\_channels, seq\_len)\).
  • normalized (bool, optional) – whether to normalize the cross-correlation with the l2 norm of input signals.
  • eps (float, optional) – machine epsilon used for numerical stabilization when normalization is used.
Returns:

out (torch.Tensor) –

cross correlation between the two multi-channel signals.

Shape: \((batch, mic\_channels, seq\_len\_ref - seq\_len\_input + 1)\).

Read the Docs v: v0.4.4
Versions
latest
stable
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.5_b
v0.3.4
v0.3.3
v0.3.2
v0.3.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.