Let's take a switch function as an example:
$
u(t)=
\begin{cases}
1, & \text{$0<t<dT_s$} \\
0, & \text{$dT_s<t<T_s$}
\end{cases}
$
How can I get Fourier series of it in Mathematica?
Is there a way to get Fourier series of arbitrary periodic piecewise function?
2 Answers
$\begingroup$
$\endgroup$
for example:
u[t_] = Piecewise[{{1, 0 < t < dT}, {0, dT < t < T}}];
FourierTrigSeries[u[t], t, 3, FourierParameters -> {1, 2 \[Pi]/T},
Assumptions -> 0 < dT < T && 2 dT == T]
$\begingroup$
$\endgroup$
1
Try u[t_] := UnitStep[Sin[t]];
FourierSeries[u[x], x, 3]
3 is series
-
1$\begingroup$ One might want to be mindful of the
FourierParameters
setting when usingFourierSeries[]
and other sundry functions, lest Mathematica's chosen normalization might not be the same as your preferred one. $\endgroup$ Commented Feb 26, 2019 at 9:15
Piecewise
andFourier
. $\endgroup$FourierSeries
, right?Fourier
is the discrete fourier transform (FFT). I am also puzzeld by the many different Fourier-related commands in Mathematica. $\endgroup$