一、fftconvlove 与 convlove 的区别:
fftconvolve 先做FFT,然后在频域相乘再转换为时域。 当序列较长时,可以利用FFT减少计算量加快运算速度。
convolve 直接在时域进行卷积
fftconvolve using the fast Fourier transform method. fftconvolve is generally much faster than convolve for large arrays (n > ~500), but can be slower when only a few output values are needed, and can only output float arrays (int or object array inputs will be cast to float).
二、参数{‘full’, ‘valid’, ‘same’}的设置
mode:str {‘full’, ‘valid’, ‘same’}, A string indicating the size of the output:
full: 输出卷积后的所有点,输出长度为 L = (L1+L2-1).
valid:只输出两个信号都重合的点,卷积中zero-padding点不输出。 输出长度为 L = max(L1, L2)-min(L1, L2)+1.
same: 输出的长度与信号1 相同。
full:The output is the full discrete linear convolution of the inputs. (Default).
valid:The output consists only of those elements that do not rely on the zero-padding. In ‘valid’ mode, either in1 or in2 must be at least as large as the other in every dimension.
same:The output is the same size as in1, centered with respect to the ‘full’ output.
三、语音信号加混响
加混响的方法为 干净语音卷积房间冲击响应。 从卷积的过程可以看出卷积操作相当于把之前帧的信号延时相加到了当前帧的信号,和混响产生原因(声音传播过程中经过多路径反射会延时叠)是一致的。