The picture shows the circuit I am working on. A sinusoidal burst of 4 MHz (24 cycles) is generated from a waveform generator. This sinusoidal input is connected to a comparator IC through an SMB jack as shown in the schematic. This comparator IC is powered by a microcontroller that is connected to a PC through a USB cable. The idea is to convert this sinusoidal wave into a square wave.
Although I am getting a square wave, there is also a lot of noise/disturbance (shown in the red circle).
There are a lot of other components connected to the microcontroller as well. I am working on a perf board and the components are connected something like the third picture.
Since the board is connected with many overlapping wires, I suspect that is the source of this noise. The 3.3 V pin of the microcontroller is especially very noisy. Would that be the right way of thinking? If yes, what would be the correct way to rectify this issue on the perfboard itself?