One of the most critical elements in the connection of photovoltaic (PV)-based systems used to generate electricity from solar energy is the inverter. The harmonic effects of the inverters to be connected to the grid should be as low as possible, and the total harmonic distortion (THD) should be less than 10%. A high THD value will distort the power quality on the grid side. For this reason, the THD value of the inverters in the grid connection approaches must be determined by spectral analysis to ensure that the necessary protection and improvements are made technically. In this study, a novel inverter topology, including six power switches and two power diodes, is presented, and the voltage data obtained from a grid-connected inverter are acquired in real time, and spectrum analysis is performed with the software developed with LabVIEW. The power efficiency of the proposed inverter is compared with conventional inverter types such as HERIC, H5, and H6 inverters. One of the novelty aspects of the proposed inverter topology is forming a proper freewheeling path including switches and diodes in the inverter branches that can provide a separate DC and ac components, and as a result, this prevents the following the PV side leakage currents to the ac grid side. In the spectrum analysis, the chirp Z-transformation (CZT) was used along the contours of the Z-transformation outside the unit circle. Using CZT, the z-transform was calculated for the inverter output voltage along the spiral lines in the z-plane. Besides, spectrum analysis was performed with fast Fourier transform (FFT) and compared with CZT. The results show that the CZT transformation is more efficient than the FFT algorithm and is useful in calculating a subset of FFT for a sequence. The performance of the proposed inverter is compared with conventional topologies. Hardware implementation and the output signals and the leakage current waveforms are also presented.