Below is figure of a transistor square-law detector. At a low quiescent collector current (95 uA), it biased to operate so the output will be significantly nonlinear.
To test the circuit, we can feed base with a 550 kHz RF signal about 30% modulated with 1 kHz which is produced by the RF signal generator. The signal has peak to peak amplitude about 50 mV. The gain is about 36 dB because the audio signal at the collector was about 1.3 V peak to peak. A square-law detector like this makes use of the amplification inherent in the device to produce a large output with a small input signal. Existence of second-harmonic distortion is the price that should be paid if the degree of modulation is high. m^2/4 is the fraction of distortion. The second-harmonic distortion amounts to 25% for 100% modulation. There is no consequence for radiotelegraphy but there’s a bit in the music.