I have a function that produces a single impulse spanning the range [-1,1]
:
func1 = Cos[Pi*(Clip[x]/2)]^2
I want to create a second function that produces a series of such pulses, with each pulse centred on an instance of EvenQ[x/3]=True
. It feels like it should be simple, but I can't figure it out. This is what I tried:
eventest = If[EvenQ[x/3] = True, 1, 0];
func2 = eventest*func1;
Plot[func2, {x, 0, 20}]
...but as you can see, it doesn't work.
What am I doing wrong?
[-1,1]
and nothing else. I'm after a series of pulses like the one I have now added to the original post, with each pulse centred on an instance ofx/3
is even. $\endgroup$