Based mostly on W. Briggs and V.E. Henson’s “The DFT : An owner’s manual to the Discrete Fourier Transform” chapter 3 and question 57 on rarified and repeated sequences, I would like to find the analytical expression for step-like functions.
I'm particularly interested in linear functions $f(n)$, sampled at $N$ points. Let's say we get from this function the values $f_n=\{a,b,c,...,m\}$, that increase or decrease uniformly. We then do an averaging at endpoints (AVED), in order to preserve the properties of the Fourier coefficients such as symmetry and being imaginary, by substituting the last value with the average ${\overline f}$ at the discontinuity : $$f_n=\{a,b,c,...,{\overline f}\}$$ I can get, analytically, an expression to calculate the DFT for these kind of sequences.
But then, based on this sequence, I would like to add "steps" of length $p$, for example for $p=3$, $$f_{pn}=\{a,a,a,b,b,b,c,c,c,...,{\overline f}\}$$ and find their DFT.
My idea was to use the repeated sequence property, as described on ex. 57, which I have done. The problem is that this property works only for sequences where all the values are repeated $p$ times, including the average one, for example if I had $$f_{pn}=\{a,a,a,b,b,b,c,c,c,...,{\overline f}\,{\overline f}\,{\overline f}\}$$ which I don't and I'm not interested on, as this defeats the whole point of taking the AVED.
So, my question is, is there a systematic way of approaching this for an arbitrary sampling $N$ and any length $p$ of steps?
And a way to do it for any given function / sequence, not necessarily a linear one?