Re: a question about the UnitStep function
- To: mathgroup at smc.vnet.net
- Subject: [mg58431] Re: a question about the UnitStep function
- From: Torsten Coym <torsten.coym at eas.iis.fraunhofer.de>
- Date: Sat, 2 Jul 2005 04:06:37 -0400 (EDT)
- Organization: Fraunhofer Gesellschaft (http://www.fraunhofer.de/)
- References: <da2msl$944$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Zhou Jiang wrote:
> Dear Mathgroup,
> I want to let Mathematica compute the convolution of two sqare waves. I did as follows
>
> f[x_]:=(UnitStep[x+1]-UnitStep[x-1])/2;
>
> integrand=f[z] f[x-z];
>
> Assuming[Element[x, Reals], Integrate[integrand, {z, -Infinity, Infinity}]]
>
> Mathematica gave me the result as follows,
> ((-1 + x) UnitStep[-1 + x] - x UnitStep[x] + (2 + x) UnitStep[2 + x])/4
>
> I plot the result to check
>
> Plot[%,{x,-10,10}, PlotRange->All];
>
> It is clear wrong since the convolution of two square waves should be convergent. Can anyone give me some help with the subtlties about the UnitStep function? Any thoughts are appriciable.
>
>
Your square wave vanishes for all values outside the interval [-1,1].
Adapting the integration interval leads to the desired result:
Assuming[x \[Element] Reals, Integrate[integrand, {z, -1, 1}]]
(1/4)*((-(2 + x))*UnitStep[-2 - x] - (-2 + x)*UnitStep[2 - x] +
2*x*UnitStep[-x])
Plot[%, {x, -5, 5}, PlotRange -> All];
Torsten