# How can I attenuate any signal to 5V peak-peak?

How can I attenuate any signal to 5V peak to peak?

I tried the following design :

While I limited the output to 5V peak-peak, the circuit clipped the output to 5V instead of attenuating it.

My main problem is that I don't know the input signal's amplitude. I don't know how to make a circuit that will attenuate the input by a variable amount to achieve an output signal that is always 5V peak-peak. What are circuit designs that will allow me to vary the gain or attenuation to produce a constant amplitude signal?

2. Short the node between the terminating resistor and buffer input, and ground, with a suitable resistor in order to divide the signal voltage to below 5V. Don't blow up the signal source with too low of an low input resistance, and you may want to include the $I_{BE}$ in the resistor calculation.