I want to evaluate a convolution for a stripe function and a Gaussian:
stripe[x_, d_] := If[EvenQ[Quotient[x, d]], 1, 0]
gaussian[x_, μ_, σ_] = 1/(Sqrt[2 π] σ) Exp[-((x - μ)^2/(2 σ^2))];
Plot[{stripe[τ, 1], gaussian[τ, 0, 0.5]}, {τ, -10, +10}]
Then, the convolution I want to evaluate is:
Convolve[UnitStep[τ + 5] stripe[τ, 1] UnitStep[5 - τ], gaussian[τ, 0, 0.5], τ, x]
the result was 0, although it should not be 0.
I also tried to evaluate it via Integrate
:
Integrate[stripe[τ, 1] gaussian[x - τ, 0, 0.5], {τ, -5, +5}]
the result was 0 again.
I don't know why the results were zero. Does the complication of the stripe function cause this problem? How can I evaluate it correctly?
Any advice would be appreciated.