Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
0answers
11 views

Convolve[…] behaves differently to that of Integrate[…] when numerically integrating the result

I am performing a convolution between two functions, and then I want to numerically integrate the result. If I go: ...
0
votes
1answer
59 views

Convolve and fitting

I want to convolve two equation, then I want to find the parameters. But it doesn't give the answer and Takes too much time. What is the wrong with my code? ...
0
votes
0answers
24 views

Help with Plot excluding parts of a curve even with “Exclusions” option set to “None” and speed up of code

I modeled a system mathematically. When the model is ideal, I can plot the results and export the plotted points. Everything works fine. Now, I started to model some imperfections of the system, but ...
2
votes
0answers
41 views

Use List convolve for aligning images

I am trying to align images of point spread functions using a convolution. Before doing it on real data, I wanted to try on simulated data. I have no problem with the 1-D case where I create 2 ...
4
votes
1answer
82 views

Using Convolve and Manipulate

im trying to demonstrate the convolution process between 2 HeavysidePi function with Manipulate. im trying to get something like this GIF. i found how to demonstrate the convolution with : ...
1
vote
1answer
45 views

normalization of convolution product when using Fourier transform

I'm trying to calculate the convolution of two probability density functions (PDFs) defined on the real axis: a normal distribution (with \[Sigma] > 0 and ...
8
votes
1answer
178 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: ...
9
votes
1answer
132 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 ...
2
votes
0answers
52 views

Visualizing Trained Filters

In the first convolutional layer of NetModel "Wolfram..." , the parameters of the filter are 64 (number of filters), and 112x112 (size). The last convolutional layer has 192 55x55 filters. What ...
0
votes
0answers
76 views

Convolution Fitting

Here I have a piecewise function g: ...
1
vote
2answers
66 views

Infinite long sequence convolution error

I use version 11.2. ...
6
votes
2answers
325 views

Incorrect evaluation of a convolution

I want to evaluate a convolution for a stripe function and a Gaussian: ...
0
votes
1answer
92 views

Simple convolution

I have two lists, x and y, each of length Nx. I'm trying to create a function that gives the cross correlation at lag n. My attempt thus far is as follows: ...
4
votes
1answer
262 views

Convolution of Gaussian and Lorentzian functions

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

Problem when trying to reverse function

A minimal example is below. I'm trying to reverse function y1d. ...
0
votes
1answer
89 views

Functional form of Delta function to perform convolution of continuous functions

I'm trying to get Mathematica to perform the convolution I need. I think it's fairly simple, just a convolution between a Normal distribution and a ...
0
votes
1answer
120 views

Numerical Integration Error

I'm new to Mathematica. I have written a code for performing a convolution integral (as follows) but it seems to be giving out error messages: My code is: ...
1
vote
2answers
166 views

Why doesn't the following code for recursive convolution work?

I'm trying to play with central limit theorem using Mathematica, so I wrote the following code, ...
0
votes
1answer
144 views

Computer convolution of sech squared function

I try to compute the analytic form of the convolution of $\operatorname{sech}$ squares function. Mathematica takes so much time to try and find the answer. Here is my code: ...
1
vote
0answers
77 views

Normalization and boundary issues with numerical convolution (ListConvolve function)

I have a somewhat messy piece-wise function that I need to convolve with a Gaussian function. Solving the problem analytically is taking forever so I would like to solve the problem numerically. ...
3
votes
1answer
232 views

Custom NetEncoder for lower resolution image input in a pre-trained Inception network

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 $...
2
votes
1answer
50 views

GaussianFilter Slow Behaviour when std. Deviation in set to 0

The problem occurs when setting the $\sigma$ of the GaussianFilter to zero and using the method Method -> "Gaussian". The ...
3
votes
0answers
95 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 ...
3
votes
1answer
106 views

Coefficients of Knuth's “Convolution Polynomials”

Donald E. Knuth gives in his paper Convolution Polynomials the code ...
4
votes
1answer
271 views

The curious case of Convolve function

For integer values of $n$, I was trying to calculate the convolution of $t^{-n}$ with itself. So I wrote this: ...
1
vote
1answer
106 views

ListConvolve returns only one value

Generating my first function ...
0
votes
1answer
80 views

Convolve does not excecute [closed]

The following Convolve expression doesn't produce a result. ...
5
votes
0answers
149 views

Implementation of the Riesz transform

Implementing the Hilbert transformation \begin{equation}H(f)(x) = \frac{1}{\pi}\lim_{\varepsilon \to 0} \int_{|x-y|>\varepsilon} \frac{1}{x-y}f(y) \, dy,\end{equation} appropriate for 1-...
1
vote
0answers
86 views

Convolve returns false result

Bug introduced in 9.0 or earlier and fixed in 10.0 I tried to convolve sin with sin and got this unexpected result: Convolve[Sin[x], Sin[x], x, y] (* 0 *) Now I ...
2
votes
1answer
98 views

Multiple discrete RV convolutions performance

I have a discrete random variable with PDF of (just a simplified example) Piecewise[{{1/3, x == 5 || x == 10 || x == 15}}, 0] Actually, in my code this is a <...
1
vote
0answers
56 views

Convolution of circular densities

I have two distributions. One is a delta function which is non-zero on a circle at radius 1, the other is filled circle of the same radius. When I calculate their convolution I get something very ...
6
votes
1answer
193 views

single slit diffraction numerical simulation

I'm trying to simulate the Fraunhoffer diffraction at slits(single,double,triple) with Mathematica. In the picture, the red one is analytical result and the green one is numerical result. The ...
5
votes
1answer
732 views

How to perform convolutions on this complicated pdf?

For a known pdf f[x], I need to calculate integrals over the probability density of the sum of Log[f[x]] over independent samples: $$Q[t,n]\equiv P(\sum_{i=1}^{n}...
1
vote
1answer
75 views

Convolution with modified indices

I want to perform convolution for a sequence but instead of having the indices cycle from the ends periodically, I want to apply a function, specifically Abs, to ...
3
votes
1answer
153 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 ...
1
vote
2answers
280 views

n fold convolution of a function via a recursion function

I wanted to write a recursion function to calculate the n-th convolution of a function f[x_]. I wrote the function ...
4
votes
2answers
556 views

How to convolve the unit box function and the modified Bessel function of the second kind in 2D?

In 1D the convolution of the unit box function and the modified Bessel function of the second kind $K_0(x)$ works very well. ...
1
vote
1answer
174 views

Using ListDeconvolve to find velocity distrbution

Consider a Distribution of Particles correspondent with the NormalDistribution: PDF[NormalDistribution[], x] The Particles also have a velocity distribution: <...
0
votes
1answer
114 views

InverseFourierTransform very slow

I determined a distribution dist = SmoothKernelDistribution[ListOfValues];. Then I determined the FT of the PDF, which is the ...
4
votes
1answer
131 views

Is it possible to recover the efficiency of ListConvolve when generalizing the convolution?

I've noticed that, while ListConvolve is very fast, it becomes much slower when you use anything but the standard Times,Plus as ...
2
votes
1answer
469 views

Basic 2D convolution with mathematica

Can anyone tell me why the following keeps burning my CPU without ever producing the desired plot? ...
0
votes
1answer
144 views

Convolution of interpolated data with function doesn't work

I need to convolve one function with interpolated data: function: av1 = 1.3888*(12/20)*10^8; bv1 = 2.5; tr5[t_] = Exp[-(av1*t-bv1)^2]; Data: ...
5
votes
1answer
370 views

How to fit data to a convolution equation

How to fit data to a convolution equation: ...
2
votes
0answers
71 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, ...
5
votes
1answer
275 views

ListConvolve with Padding -> Fixed?

The built-in function ImageConvolve takes a Padding option that "specifies what padding to use when extending beyond the ...
13
votes
1answer
229 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 ...
7
votes
2answers
172 views

Good coding for a tricky expansion with convolutions, limits, substitutions

I am attempting to generate a power series in $v$ as $v\rightarrow0$ for $$g(x,v)\equiv \ln\int_{-\infty}^{\infty}e^{-y\left(z\right)}N\left(x-z,v\right)\,\mathrm{d}z $$ where $y(x)\equiv\sum_{i=1}...
4
votes
1answer
768 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 ...
3
votes
0answers
158 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 ...
2
votes
0answers
205 views

Performing a convolution for smoothing a function

I want to smooth a one-dimensional oscillating function by convolving it with another function that I'll call the screening function. This screening function should have a trapezoidal form and go to ...