# Questions tagged [convolution]

Tags for questions about convolution, including the Mathematica functions Convolve, DiscreteConvolve, ListConvolve, DirichletConvolve, ImageConvolve, and convolutions using Fourier, FourierTransform, or LaplaceTransform.

114 questions
Filter by
Sorted by
Tagged with
4k views

### How to find the center of a circular pattern?

I am writing an algorithm that finds the center of 500 x 500 pixels images coming from a live feed from a camera at 50 Hz. So it has to be quick! The images are images of an optical field which looks ...
3k views

### Convolution with interpolated function

I have some problems to calculate in reasonable speed the convolution of an interpolated function with a Gauss function. I have here (ExampleData.txt, alternate Pastebin link) data which I ...
251 views

### Why do singularities disappear when performing convolutions with the Dirac Delta function?

Bug introduced in 9.0 or earlier and fixed in 10.4 I am attempting to perform a convolution involving the Dirac Delta function: $\int_{-\infty}^{\infty} \frac{1}{t+1} \cdot \delta(t+1)\ dt$ I would ...
225 views

### ListConvolve Memory Hemorrhage

Bug introduced in 10.0.0 and fixed in 10.2.0. I wrote a routine that convolves an impulse response array with a test array and checks for the RMS difference between that convolution and a data array. ...
4k views

### cross-correlation with time lag

I have two lists with some data. a={1,2,3,4,5} b={5,4,3,2,1} Now I want to compute the cross correlation of the two lists with a time lag of 1, like it is ...
2k views

### Sparse convolution of sparse arrays

The documentation for ListConvolve mentions that "ListConvolve works with sparse arrays", which is true. The result, however is never sparse, eg: ...
4k views

### Discrete Convolution

Ask to compute the convolution of 2 lists, I managed to do so, with what I feel is rather heavy : Let my 2 lists be : a = {1,2,3,4} b = {1,1,1,1,1,1}; The below function adds 0s on each part of ...
234 views

### NetEncoder for images of “Varying” dimension?

I'm looking for someway to do what this syntax "should" do: NetEncoder[{"Image", Automatic, ColorSpace -> "RGB"}] /@ imgs; The documentation states that ...
1k views

### Speed up Mathematica code involving Convolve

I'm trying to plot the averaged autocorrelation function of a random wire profile $\xi(x)$ which is build from unitsteps which are each L units long. To calculate the average I'm generating nMax ...
496 views

### The curious case of Convolve function

Bug Introduced in Version 11 or earlier and persisting through 12.0 For integer values of $n$, I was trying to calculate the convolution of $t^{-n}$ with itself. So I wrote this: ...
501 views

### Use of Cellular Automaton or Discrete Convolution to calculate Potts Energy of a 2D Matrix

In a project of Monte Carlo Modelling of Grain Growth (Link) one of the most costly subroutines is the calculation of the Potts-Energy of an Monte Carlo Grid cell by comparing the center cell value ...
218 views

### Dilation on 3D Images?

I need to apply a dilated convolution to a 3D image, but dilation values greater than 1 are not currently supported in v11.3: ...
723 views

### Does Mathematica reuse previous computations?

I am doing an analysis of experimental results in which I need to repeat the same GaussianFilter hundred of times on different data. As explained in the ...
181 views

331 views

### Can I use ListDeconvolve or any other functions to get the original kernel?

I have seen an example in the help document: data1 = {0., 0., 1., 2., 1., 2., 1., 0., 0., 0.}; ker = {1/3, 1/3, 1/3}; conv = ListConvolve[ker, data1, 2] my question ...
1k views

### Challenge: deblurring images [duplicate]

My friend came back from holidays, where he took lots of pictures. Unfortunately, the camera was set on manual focus and most pictures are blurry. It got me thinking that mathematica showed how to ...
519 views

### Convolution of Gaussian and Lorentzian functions

I have a Gaussian and a Lorentzian function here; gd[v_] = Sqrt[(4*Log/Pi)]*(1/Dw)*Exp[-4*Log*((v - v0)/Dw)^2] gl[v_] = (Lw/2/Pi)/((v - v0)^2 + (Lw/2)^2); ...
479 views

### How to fit data to a convolution equation

How to fit data to a convolution equation: ...
336 views

### ListConvolve with Padding -> Fixed?

The built-in function ImageConvolve takes a Padding option that "specifies what padding to use when extending beyond the ...
887 views

4k views

### Convolution of two distribution functions

I have two functions; f[x_] = (1/k) Exp[-x/k] ; g[x_] = (1/p) Exp[-x/p] ; How I can convolve them? In Mathematica for convolving two functions we have this ...
136 views

### Coefficients of Knuth's “Convolution Polynomials”

Donald E. Knuth gives in his paper Convolution Polynomials the code ...
166 views

### Why is DiscreteConvolve incorrect?

Bug introduced in 9.0 or earlier and fixed in 11.0.0 Let $h[n]=(\frac{1}{2})^n u[n]-3(\frac{1}{2})^{n-1}u[n-1]$ $g[n]=3^n u[n]-\frac{1}{2}3^{n-1}u[n-1]$ I convolved $h[n]$ and $g[n]$ in ...
121 views

### Speedup ListCorrelation when using generalized correlation function

ImageCorrelation provides several general function that can be used to replace the default Dot function. For example, in the documentation of ImageCorrelation, ...
83 views

### How to prove a numerical identity?

Let be a function power function f[s_, r_] := Piecewise[{{s^r, s >= 0}, {0, True}}]; And its convolution ...
I have come across this neat explanation on how to adjust a pre-trained Inception neural net to an arbitrary number of classes by truncating the top layers. However, my input data does not come in $... 0answers 230 views ### Deconvolution using Fourier transforms I have a 2D signal in the form of a function$g(x_m,y_m)given as \begin{aligned} g(x_m,y_m) = \ & \int^{\infty}_{-\infty} \mathrm{d}x_o \ \mathrm{d}y_o \ \frac{1}{\varepsilon^2} P(x_o - x_m,... 0answers 109 views ### Symbolically find optimal convolution algorithm [closed] A large portion of deep learning research goes into convolution neural networks, hence there's a need for a fast algorithm. I wonder if an optimal convolution algorithm can be found symbolically with ... 0answers 205 views ### Analytical Fourier Transforms with convolution rule [closed] The task is the following, how to extend Mathematica's FourierTransform command in order to be able to analytically deal with non-linear differential equations. To do so it should be able to deal with ... 0answers 614 views ### How to make 3D object smooth? This thread considers mathematical methods here to make the 3D object smooth but this question consider how to achieve the goal of smoothing a 3D object in Mathematica. I want to get smoother ... 1answer 155 views ### Remove singularity at zero from -((i^{-n} (-1 + i^n)^2)/(n^2 π^2)) The expression h[n_] = -((I^-n (-1 + I^n)^2)/(n^2 π^2)) is real for all integers n. Although indeterminate at ... 1answer 92 views ### Switch Function Is Not Working Properly I'd like to select between the Tent and Hat function to convolve, but my switch function produces an error. I don't exactly need the initial plots. But I would like to plot the two that I select. <... 1answer 290 views ### Analog of MATLAB's conv2 in Mathematica? I have a matlab code filter = 1; F = conv2(double([1 2 1]),double([1 2 1]'))/16; for i=1:some_integer filter = conv2(double(filter),double(F)); end In the ... 1answer 166 views ### Rewrite the power sum in terms of convolution Let be an identityn^{2m+1}=\sum_{r=0}^{m}A_{m,r}\sum_{k=0}^{n-1}k^r(n-k)^r,$where$A_{m,r}$are real coefficients, see A302971 for numerators and formula of$A_{m,r}$. Here we can notice that$\...
The problem occurs when setting the $\sigma$ of the GaussianFilter to zero and using the method Method -> "Gaussian". The ...