Assume I have some function $f$ such that its range is $[0,1]$
Assume the function looks somewhat like this: (and excuse the lack of artistic skill) :
(Note the function is NOT actually periodic, i.e there's no assumption that $f(x) = f(x + h)$ for some h. But it is "pseudo periodic" in that for all $x$ there exists $x'$ such that $f(x) = f(x')$ and $|x - x'| \approx h $for some $h$ and some tolerance for variance ).
The function is guaranteed to be continuous.
We want to take $f$ and map it to $h$ such that "$h$ is a bumpy version of $f$".
"Bumpy" means that every local maximum is preserved. But the values around the local maximum are lowered.
A similar pattern to what happens if you plot $\Big(\frac{cos(x) + 1}{2}\Big) ^ {80}$.
Except that the above operation has a tendency to fully flatten the "valley" region, whereas I need to preserve curvature in the concave regions of the function. I just need to "sharpen" the tops of the hills.
Apologies for the non technical language, I do not know the formal name for the curve properties I am trying to describe.


One solution to this problem could be to multiply the signal by a periodically extended "Gaussian". Suppose the position of the maxima is approximately at $x=x_0+nT$ where $T$ is the period. Then consider the function
$$g(x)=\sum_{n=-\infty}^{\infty}e^{-\frac{(x-x_0+nT)^2}{2\sigma^2}}$$
This function is periodic and it has the tunable parameter $\sigma$. There must be an intermediate regime for this parameter (not too small, in which case the valleys will be extremely flat, and not too big, because then the valleys will not be depressed at all).
For implementation purposes, note that the function can be written in terms of a Jacobi theta function, which is well implemented in Mathematica:
$$g(x)=e^{-\frac{(x-x_0)^2}{2\sigma^2}}\theta_3\Big(\frac{iT(x-x_0)}{\sigma^2},\frac{iT^2}{\pi\sigma^2}\Big)$$
For a particular example, I consider the function $f(x)=1+\cos(2\pi x)$ and with the following mathematica code we can plot this (orange is the original function, blue is the modified one).