I have $x(t)= \begin{cases} 2,& 0 < t < 2 \\ 1,& 2 < t < 3 \\ 0,&\text{elsewhere} \\ \end{cases},\ $ and I'm trying find the Fourier fransform of $y(t) = \cos^2(ωt)x(t)$
What I have done:
I have proceeded solving it using the definition of the Fourier Transform, but I would like to believe there is an easier way to find the result.
$ \begin{align} Y(f) & = 2\int_0^2 cos^2(ωt)e^{-jωt}dt + \int_2^3 cos^2(ωt)e^{-jωt}dt\\ & = 2\int_0^2 \left({1\over2} + {1\over2}cos(2ωt)\right)e^{-jωt}dt + \int_2^3 \left({1\over2} + {1\over2}cos(2ωt)\right)e^{-jωt}dt\\ & = \int_0^2 e^{-jωt}dt + \int_0^2 cos(2ωt)e^{-jωt}dt + {1\over2}\int_2^3 e^{-jωt}dt + {1\over2}\int_2^3 cos(2ωt)e^{-jωt}dt\\ & = \left[{{e^{-jωt}}\over{-jω}}\right]_0^2 + \int_0^2 \left({{e^{j2ωt} + e^{-j2ωt}}\over{2}}\right)e^{-jωt}dt + {1\over2}\left[{{e^{-jωt}}\over{-jω}}\right]_2^3 + {1\over2}\int_2^3 \left({{e^{j2ωt} + e^{-j2ωt}}\over{2}}\right)e^{-jωt}dt\\ & = {{1 - e^{-j2ω}}\over{jω}} + {1\over2}\int_0^2 e^{jωt} + e^{-j3ωt}dt + {{e^{-j2ω} - e^{-j3ω}}\over{j2ω}} + {1\over4}\int_2^3 e^{jωt} + e^{-j3ωt}dt\\ & = {{1 - e^{-j2ω}}\over{jω}} + {{e^{j2ω} - 1}\over{j2ω}} + {{1 - e^{-j6ω}}\over{j6ω}} + {{e^{-j2ω} - e^{-j3ω}}\over{j2ω}} + {{e^{j3ω} - e^{j2ω}}\over{j4ω}} + {{e^{-j6ω} - e^{-j9ω}}\over{j12ω}} \end{align} $
I'm using $ω = 2πf$ to preserve space.
Question:
The function $x(t)$ is evidently a sum of rectangular pulses:
$x(t) = 2rect\left({{t - 1}\over2}\right) + rect\left(t - {5\over2}\right)$.
Is there a way to take advantage of the properties of Fourier Transform to find $Y(f)$ quickly without so much writing action?
I'm going to assume the modulation function is $$ f(t) = \cos^2(2\pi f_0 t) = \frac12 + \frac12 \cos (4\pi f_0 t) = \frac12 + \frac14 e^{j4\pi f_0 t} + \frac14 e^{-j4\pi f_0 t} $$
of which the Fourier transform is $$ F(f) = \frac12 \delta (f) + \frac14 \delta (f - 2f_0) + \frac14 \delta (f + 2f_0)$$
Then the transform of a product is a convolution
$$ \mathcal{F}\{f(t)x(t)\} = F(f) * X(f) = \frac12 X(f) + \frac14 X(f - 2f_0) + \frac14 X(f + 2f_0) $$
where $X(f)$ is the Fourier transform of $x(t)$. Since you have already expressed $x(t)$ as the sum of two $\operatorname{rect}$ functions, this is easily the sum of two (frequency-shifted) $\operatorname{sinc}$ functions