You can get analogue transmission gates (like switches) - type 4066, you can control these with digits to open and close, so you build a selection of them to switch in series resistance in your signal path and shunt resistance. Typically with a logerithmic ratio, so S1 does - 1dB, S2 -2 dB, S3 - 4 dB S4 - 8 dB, So by selecting which switches are open and closed already you have a 0 - 15 dB attenuator, add a few more switches, make the range lower so S1 is .5 dB. . . you can design what you want.
Frank