Fourier coefficients of discrete difference of a square wave I have a discrete square wave $f(t)$ where $t \in \mathbb{N}$, of amplitude $A$, period $T$ and duty cycle $1/T$
$$
f(t) = \left\{\begin{matrix}
A, &amp; \mathrm{if}\;t=Tn\\ 
0, &amp; \mathrm{if}\;t\neq Tn
\end{matrix}\right.
\;,\; n \in \mathbb{N}
$$
size = 23
T = 5
A = 10
t = np.arange(size)
f = np.zeros(size)
f[t%T==0] = A
fig, ax = plt.subplots(figsize=(12, 5))
ax.step(t, f)
ax.set(
    xticks=t,
    xlabel='time $t$',
    ylabel='amplitude $A$',
    title=f&quot;Square wave of amplitude {A}, period {T} and duty cycle 1/{T}&quot;
)
plt.show()


Given the Fourier series
$$
\mathcal{F}[g(t)] = a_0 
+ \sum_{h=1}^{\infty} a_h \cos(2 \pi h \nu \cdot t) 
- \sum_{h=1}^{\infty} b_h \sin(2 \pi h \nu \cdot t) 
$$
for this square wave
$$
a_0 = \frac{A}{T}
$$
$$
a_h = \frac{2A}{\pi h} \sin \left( \frac{\pi h}{T} \right)
$$
$$
b_h = 0
$$
so
$$
\mathcal{F}[f(t)] = \frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot t\right) 
$$
where the Fourier coefficients of harmonic $h$ is $\frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)$.
The discrete difference of $f(t)$
$$
f'(t) = f(t) - f(t-1)
$$
is the sum of two square waves $f(t)$ and $-f(t-1)$ with opposite amplitude and shifted by a sample unit
$$
f'(t) = \left\{\begin{matrix}
+A, &amp; \mathrm{if}\;t=Tn\\ 
-A, &amp; \mathrm{if}\;t=Tn+1\\ 
0, &amp; \mathrm{otherwise}
\end{matrix}\right.
\;,\; n \in \mathbb{N}
$$
t1 = t[1:]
f1 = np.diff(f)

fig, ax = plt.subplots(figsize=(12, 5))
ax.step(t1, f1)
ax.set(
    xticks=t,
    xlabel='time $t$',
    ylabel='amplitude $A$',
    title=f&quot;Discrete difference of a square wave of amplitude {A}, period {T} and duty cycle 1/{T}&quot;
)
plt.show()


We can thus say (is it correct?) that the Fourier series of $f'(t)$ is the sum of the Fourier series $\mathcal{F}[f(t)]$ and $\mathcal{F}[-f(t-1)]$
$$
\mathcal{F}[f'(t)] = 
\left[
\frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot t\right) 
\right]
-
\left[ 
\frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot (t-1)\right) 
\right]
$$
$$
\mathcal{F}[f'(t)] = 
\sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left( \frac{\pi h}{T}\right)
\left[ 
\cos\left( \frac{2 \pi h}{T} \cdot t\right) -
\cos\left( \frac{2 \pi h}{T} \cdot (t-1)\right)
\right]
$$
How can I get the Fourier coefficient of harmonic $h$ from $\mathcal{F}[f'(t)]$?
Is there a better way to express the Fourier series of $f'(t)$?

EDIT #1
As @MattL. noticed (see comments) what I'm dealing with is actually a discrete-time signal, so a better representation of the signal would be

and for the discrete difference will look like
It's quite straightforward to express the Fourier coefficients of a shifted version of a function in terms of the Fourier coefficients of the original function.
If the Fourier series of a $T$-periodic function $f(t)$ is given by
$$f(t)=\sum_{k=-\infty}^{\infty}c_ke^{j2\pi kt/T}\tag{1}$$
then it follows that the Fourier series of a shifted version must be
$$\begin{align}f(t-t_0)&amp;=\sum_{k=-\infty}^{\infty}c_ke^{j2\pi k(t-t_0)/T}\\&amp;=\sum_{k=-\infty}^{\infty}c_ke^{-j2\pi kt_0/T}e^{j2\pi kt/T}\\&amp;=\sum_{k=-\infty}^{\infty}\tilde{c}_ke^{j2\pi kt/T}\tag{2}\end{align}$$
Hence, the Fourier coefficients of $f(t-t_0)$ are given by
$$\tilde{c}_k=c_ke^{-j2\pi kt_0/T}\tag{3}$$
And, by linearity, the Fourier series coefficients of $g(t)=f(t)-f(t-t_0)$ are
$$d_k=c_k-\tilde{c}_k=c_k\big(1-e^{-j2\pi kt_0/T}\big)\tag{4}$$

For periodic discrete-time sequences we can use the Discrete Fourier Tansform (DFT), which is just a discrete Fourier series representation:
$$x[n]=\frac{1}{N}\sum_{k=0}^{N-1}X[k]e^{j2\pi nk/N}\tag{5}$$
with
$$X[k]=\sum_{k=0}^{N-1}x[n]e^{-j2\pi nk/N}\tag{6}$$
In a completely analogous manner to the continuous-time case, we can derive an expression for the DFT coefficients of the sequence $y[n]=x[n]-x[n-n_0]$, $n_0\in\mathbb{Z}$:
$$Y[k]=X[k]\big(1-e^{-j2\pi n_0k/N}\big)\tag{7}$$