Questions tagged [convolution]

A mathematical operation that combines two signals to generate a third signal. Convolution often arises in audio processing (e.g., filtering, reverb) and image processing (e.g., blurring, edge detection).

Convolution takes two signals and combines them to generate a third signal. For 1-D signals, the operation can be thought of as sliding the time-reverse of one signal along the other, and at each time step, taking the integral of the product of the signals (see wikipedia). The convolution operation describes the response of linear time-invariant systems to common input signals. Therefore, it commonly occurs in digital signal processing (DSP) contexts. Audio and image processing are two very common application areas for convolution.

A simple implementation for convolving two discrete time signals requires M*N multiply-add operations, where M and N are the lengths of the two signals. However, by taking advantage of the fact that convolution in the time domain is equivalent to multiplication in the frequency domain, and that transforming between domains can be implemented with O(N*log N) operations, convolution can be sped up. See here for more details.


Related tags

2052 questions
0
votes
1 answer

How Conv2d works in different input dimension and filter dimension?

I wonder how TensorFlow conv2d works in different input dimensions and filter dimensions. For example, the input shape of a Conv2d layer is [1, 13, 13, 10] and the filter shape is [20, 3, 3, 10] (will use 20 3x3 filters, no pedding)). In this…
0
votes
1 answer

binary classifying model in pytorch using cnn

i build a classifying model about phishing site. 1. first, about my data num_dataset: i have about 16000 dataset num_feature: my dataset has 12 characterisitics. label: if it's a phishing site, i set it's label -1. else 1 batch_size: set…
UiJin
  • 175
  • 1
  • 1
  • 6
0
votes
1 answer

Convolution of two symbolic arrays on Matlab

I have two arrays: p1=[sym(1) sym(2)] p2=[sym(3) sym(4)] I want to do the convolution of those two lists using conv function. Matlab outputs the following: Error using conv2 Invalid data type. First and second arguments must be numeric or…
C.S.
  • 105
  • 4
0
votes
1 answer

Python convolution with histogram and Gaussian

I have a simulated signal which is displayed as an histogram. I want to emulate the real measured signal using a convolution with a Gaussian with a specific width, since in the real experiment a detector has a certain uncertainty in the measured…
0
votes
1 answer

Difference between TimeDistributed(Conv1D) and TimeDistributed

I could not understand the difference between TimeDistributed(Conv1D) and Conv1D in TensorFlow Keras. In this example, it is given that TimeDistrbuted(Dense) and Dense are equivalent as it applies to the last dimension. I can see the same outputs…
Vinay
  • 33
  • 5
0
votes
0 answers

How do I fix this Convolution Algorithm? (C++)

What can I do to fix this algorithm? I'm using iPlug 2 to make a VST plugin that uses convolution. Right now it outputs very loud and high-pitched frequencies. My goal is to take in 100 samples at a time (and while that's happening the output is…
aaaa123
  • 1
  • 1
0
votes
0 answers

2D convolution product of a 3D image by FFTW3

I have RGBalpha images stored in a row-major array of structures (RGBa, RGBa, etc.) as 32 bits floats in C99. I need to blur them using large, non-separable, 2D kernels, channel by channel (each channel gets the same kernel). So I figured using the…
Aurélien Pierre
  • 604
  • 1
  • 6
  • 20
0
votes
0 answers

Graphic Convolution

When applying grey scale photographic convolution, should I set the input as the gamma compressed grey Scale or the inversed the gamma compressed grey Scale? I usually see people convoluting the Red Green and Blue separately. I think somehow I am…
emily
  • 45
  • 1
  • 9
0
votes
1 answer

fold/col2im for convolutions in numpy

Suppose I have an input matrix of shape (batch_size ,channels ,h ,w) in this case (1 ,2 ,3 ,3) [[[[ 0., 1., 2.], [ 3., 4., 5.], [ 6., 7., 8.]], [[ 9., 10., 11.], [12., 13., 14.], [15., 16., 17.]]]]) to do a convolution with it…
user15770670
  • 105
  • 6
0
votes
1 answer

Using MultiDimensional (2D) arrays as enums for Kernel convolution matrices

I'm making a very basic Image Processing program in Java and I have a few pre-defined 3x3 matrices for various convolutions (sharpens, blurs, edge detections etc) I have them hard coded for now for testing purposes but am trying to put them in a…
Conor Timlin
  • 100
  • 8
0
votes
0 answers

Convolution produces a very dark image

Edit: I included an example of k value. Also to be clear I produce three separate arrays from an RGB image . I also include code for loading the image public static final int[][] SHARPEN = { { -1, -2, -1 }, { 0, 0, 0 }, { 1, 2, 1 } }; Load…
0
votes
0 answers

Deconvolution of system response in Python/Matlab

I had two sets of data, the output function of the system (time series with a length of 1292 entries) and the transfer function (similar to a gaussian with a length of 681 entries). I would like to calculate the input function(unknown) using…
0
votes
1 answer

2D convolution along three orthogonals (axis) for 3D volumetric image

Since 3D convolution requires too much computational cost, so I prefer to use 2D conv. My motivation here is using 2D conv for volumetric images to reduce this cost. I want to apply 2D convolution along three orthogonals to get 3 results, each…
0
votes
1 answer

Python image processing: How do you align images that have been rotated and shifted?

Here I have some code that can vertically and horizontally shift images so that a specific feature can align (credits to https://stackoverflow.com/a/24769222/15016884): def cross_image(im1, im2): im1_gray = np.sum(im1.astype('float'), axis=2) …
Solveig
  • 35
  • 9
0
votes
1 answer

scipy.signal.convolve flips axis in result when using 'same'

I'm using scipy.signal.convolve to apply a simple filter to a grayscale picture My inputs are as follows: kk -> filer (2x2) im -> image (500x800) opened via pillow >>> from scipy.signal import convolve as cv >>> kk [[1, 2], [1, 2]] >>> im.size (500,…
mhk777
  • 83
  • 1
  • 9