How can I plot functions defined using supremum?

I have the following function

$$f_n(x) := \text{sup} { \frac{j}{2^n} : j \in Z, \frac{j}{2^n} \leq \text{min} ( f(x),2^n)}$$

This expression is important in measure theory and I would like to study it. Could someone explain to me how I would be able to plot this?

Unfortunately supremum is not a supported function in Desmos, and I personally don’t know if it is possible mathematically to express that same function without using supremum.

My suggestion would be to try plotting using Wolfram Alpha. Or, ask ChatGPT if there are ways to express that function without the use of “sup”.