Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: a question about the UnitStep function


Pratik Desai wrote:

>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. 
>>
>>
>> 
>>
>>    
>>
>Try this,
>f[x_]:=(UnitStep[x+1]-UnitStep[x-1])/2;
>integrand1=f[x] f[x-1]
>d[\[Omega]_]=FourierTransform[integrand1,x,\[Omega]]//ExpToTrig//Simplify
>g[x_]=InverseFourierTransform[Evaluate[d[\[Omega]]],\[Omega],x]
>DisplayTogether[Plot[f[x],{x,-10,10}],Plot[f[x-1],{x,-10,10}]]
>Plot[g[x],{x,-10,10}]
>
>Hope this is what your are looking for
>
>  
>
Hello all,

After seeing other posts, I realize my post was obviously wrong. I 
sincerely apologize for that.  Although my approach using fourier 
transform should work for example if I change my approach as shown 
below, I  get a triangular wave but not what everybody else is getting
Clear[f,d,d1,h,z]
f[x_]:=(UnitStep[x+1]-UnitStep[x-1])/2;
d[\[Omega]_]=FourierTransform[f[x],x,\[Omega]]
d1[\[Omega]_]=FourierTransform[f[x-1],x,\[Omega]]
h[x_]=InverseFourierTransform[d[\[Omega]]*d1[\[Omega]]//FullSimplify,\[Omega], 
x]
Plot[h[x],{x,-10,10}]

Best Regards

Pratik

-- 
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134



  • Prev by Date: Re: how to find n in expression x^n using a pattern?
  • Next by Date: Re: How build a function repeating the same pattern?
  • Previous by thread: Re: a question about the UnitStep function
  • Next by thread: Re: a question about the UnitStep function