I'm driving the base of a 2N2222A transistor with a square wave of fixed frequency and variable duty cycle to control fan speed. The problem is that the nice clean square wave that I have with a resistive load turns into a jumbled mess while driving the transistor, it looks more like a sine wave. The fan still runs and the speed can still be controlled. I have tried frequencies from 50 Hz to 20 KHz as well as several different base resistor values from 220 ohms to 2.2K ohms. The base driving signal is coming from a 741 op amp. Is the input capacitance of the transistor affecting the signal? I'm not sure what to try to correct this.