0

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?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574

2 Answers2

2

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]

enter image description here

rmw
  • 1,950
  • 6
  • 9
1

Try u[t_] := UnitStep[Sin[t]]; FourierSeries[u[x], x, 3] 3 is series

XinBae
  • 617
  • 3
  • 9
  • 1
    One might want to be mindful of the FourierParameters setting when using FourierSeries[] and other sundry functions, lest Mathematica's chosen normalization might not be the same as your preferred one. – J. M.'s missing motivation Feb 26 '19 at 09:15