频域下采样信号

问题描述

已知时域中的卷积等于输入和滤波器的 FFT 的元素明智。

时间缩放属性说:

所以,我的问题是:我可以在频域应用下采样(卷积网络中步幅> 1)并获得与时域卷积相同的结果吗?在 Python 中,dowsampling 因子等于 2(步幅 = 2)的一个例子是:

# Dimensions
dims_img = [256,256] # Image dimensions
dims_kernel = [3,3] # Kernel dimension
fft_dims = dims_img + dims_kernel - [1,1] # Number of points in FFT
img = np.random.random(dims_img) # Random values between o and 1 for image
kernel = np.random.normal(0,0.5,dims_kernel) # Random normal values for kernel

# Image and kernel FFT's
fft_img = np.fft.fft2(img,fft_dims) # Image fft
fft_kernel = np.fft.fft2(kernel,fft_dims) # Kernel fft

# Element wise to perform 2d convolution in frequency domain
fft_conv2d = fft_img * fft_kernel

# Now,to realize the downsampling,I convert newly 
# my signal (fft_conv2d) to time domain  and I apply
# the downsampling (strides)
time_conv2d = np.fft.ifft2(fft_conv2d) # Convert siganl to time domain
# Apply downsampling to signal
down_conv2d = time_conv2d[0::2] #  I get only one of every two samples 

我了解时间缩放属性,但我认为我需要在 FFT 的元素明智之前应用此属性,但是如果我这样做,卷积就不正确......这是正确的吗?

我见过的一些相关问题是:

Using FFT-Convolution when stride>1

https://dsp.stackexchange.com/questions/66464/handling-stride1-in-fft-based-convolution

https://inst.eecs.berkeley.edu/~ee123/sp18/Sections/sec6.pdf

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)