Finding a periodic bijection on the set of bitstrings Let $S$ be the set of bitstrings of length $n$. For $x\in S$, let $W(x)$ be the Hamming weight of $x$ i.e. number of ones in $x$.

I am trying to find a bijection $f:S\to S$ which maps bitstrings in the following periodic manner. Bitstrings of low weight are mapped to bitstrings of medium weight. Then bitstrings of medium weight are mapped to bitstrings of high weight and finally the high weight ones are mapped back to low weight ones.

My attempt: Consider $x\in S$. If we take the $XOR$ of the $n-$bits of $x$, append the result to $x$ and pop the first bit of $x$ to get a bitstring say $y$. Then let $f(x)=y$ defines a bijection. But this bijection doesn't satisfy the above requirements because $W(f(x))=W(x)+1$ if $W(x)$ is odd and the first bit of $x$ is $0$ and $W(f(x))=W(x)-1$ if $W(x)$ is even and the first bit of $x$ is $1$.
So with this $f$, we move up/down a weight class depending on whether the current weight is odd/even and it's clearly not periodic. So instead of moving up/down, I would like a bijection that only goes up weight classes initially, then we reach medium weight at which point we need to go down weight classes as described above.
I've gotten very helpful answers on other types of bijections on $S$ here before. This is a part of a larger problem I'm working on: Random walk on the set of bitstrings and this $f$ helps me shuffle the bitstrings so that the random walk converges to its stationary distribution faster.
EDIT: Just a note on the comment below by Ross. If we map weight $1$ strings to weight $2$ strings and so on and keep the remaining strings mapped to themselves, then a whole lot of strings do not change weight because they are mapped to themselves. I am trying to avoid that. The strings don't have to change weight only by $1$. Also, a lot of strings need to change weight as opposed to the previous example.
 A: You can start with an order that has the numbers sorted by number of bits, then lexicographically.  For four bits, that would give the order $0,1,2,4,8,3,5,6,9,10,12,7,11,13,14,15$.  Then you can write a function that steps you once along the order.  If the lowest bit is $1$ it looks at the string of $1$ bits from the bottom and shifts the top one into the place above.  If the lowest bit is $0$ it looks at the lowest $1$.  If it has a $0$ above it it shifts that $1$ by one place.  If it has a $1$ above it, it shifts the top of the string of $1$s up one place and all the lower $1$s into the lowest places.  If it carries out the top it just fills one more bit from the bottom than the previous word had.  You need special rules for $0 \to 1$ and all $1$s $\to 0$.  Now choose a number of steps to go each time.  For the four bit one, three steps is reasonable, giving an order of $0,4,5,10,11,15,2,3,9,12,13,1,8,6,12,13$  Maybe you would prefer five steps, giving an order of $0,3,12,15,8,10,14,4,9,13,2,6,11,1,5,7$.  Now only $3$ has the same weight as its successor.
