# Why am I getting this distortion in this circuit?

Can someone explain to me why I am getting this distortion for the following circuit? Input is a pure square wave. It happens at any input frequency or voltage. I was thinking the output would be a pure square wave, just much higher voltage. It has noticeable spikes and seems to go down in voltage slightly after. I know this won't affect the sound that much, but I would at least like to know why it is happening, and some strategies to mitigate it.

• Can you write some words to describe what exactly is catching your attention? Or draw little circles to highlight them? Things that seem outrageous to you might seem normal to me and I would just skim over them looking for whatever it is that is bothering you. Is it that you don't like the little spikes at the edges of the green line? Commented Sep 26, 2023 at 23:31
• @periblepsis Yes that's right. I was thinking the output would be a pure square wave, just much higher voltage. It has noticeable spikes and seems to go down in voltage slightly after. I know this won't affect the sound that much, but I would at least like to know why it is happening, and some strategies to mitigate it. Commented Sep 26, 2023 at 23:35
• What do you think is happening when the edge transition takes place? Consider C3 and C7 and the NE5532 inputs. Commented Sep 27, 2023 at 0:00
• @periblepsis I'll try this. I'm not even a year into electronics so forgive me if I get it wrong, but c3 and c7 filter out the dc offset, but also might cause some kind of a time delay? Although wouldn't that effect it by rounding the peaks at the zero crossing? I'm not really sure, and I would really appreciate an explanation as this is clearly showing a hole in my knowledge Commented Sep 27, 2023 at 0:20

There are series capacitors in the signal path. A capacitor’s impedance is related to the rate of change of the applied voltage. For the edges of the square wave the voltage changes quickly so the impedance is low, for the top and bottom the voltage changes slowly so impedance is high. On transitions you get a spike, between them the voltage falls off.

• Thank you so much! This was a very concise and helpful explanation for me! Commented Sep 27, 2023 at 0:50

The capacitors circled with red will cause a higher gain during the switching transient.

Because you are using a split supply these capacitors are not necessary unless they are there for an audio effect.

The capacitor circled with blue likely is causing the ramp-top instead of flat top.

The capacitor along with the potentiometer is a kind of tone control, so the ramp-top is part of the filtring of the higher frequencies. It is normal for this application. Do not try to fix it.

• Thank you for the reply. Unfortunately, when I take out capacitors C4 and C5, I get no output from my simulation. I was aware that they weren't necessary, but for some reason, there is no output without them. Commented Sep 27, 2023 at 0:52
• When they are removed, they must be replaced with a short. Did you do that? Commented Sep 27, 2023 at 0:55
• Yeah I did. Still no output. It won't cause any problems if I leave them right? Commented Sep 27, 2023 at 0:58
• Sorry can't say. Should work without them. Commented Sep 27, 2023 at 1:14