|
From: Peter P. <pet...@fa...> - 2025-11-28 14:36:19
|
* Martin Guy <mar...@gm...> [2025-11-28 12:34]:
[...]
> Someone suggested being able to convolve one audio signal with another.
> The classic application of convolution is recording a spark gap discharge
> in an audotorium, then "multiplying" that with a dry audio signal and
> obtaining what the dry sound would have sounded like if it had been
> played at the position of the spark gap, from the point of view of the
> microphone(s).
>
> The closest SoX come to this is that you can dump one signal in a text
> file as values between -1 and +1, filter that to remove the first
> column of timestamps and feed that to the `fir` effect,
>
> sox INPUT_1 -t dat - | awk 'NR>2 { print $2 }' | sox INPUT_2 OUTPUT fir
>
> which works but.
>
> The issue is https://codeberg.org/sox_ng/sox_ng/issues/702
> and the question is how to provide direct audio convolution,
> as an alternative input file to "fir" or as a way of --combining
> two audio inputs.
As might be known, convolution can be achieved by fourier transforming
both soundfiles into the frequency domain, multiplying the two spectra
there and transforming the result back into the time domain. This is
usually much cheapter wrt. cpu usage as the time domain sample-wise
multiplication and a standard way for convolving where low latency is
not a requirement.
brutefir is one widely available command line program for offline or
realtime convolution https://torger.se/anders/brutefir.html using an
optimized partitioned frequency domain algorithm.
best, P
|