We propose and demonstrate a photonic-assisted approach for generating arbitrary microwave waveforms based on a dual-polarization dual-parallel Mach–Zehnder modulator, offering significant advantages in terms of tunability of repetition rates and anti-dispersion capability. In order to generate diverse microwave waveforms, two sinusoidal radio frequency signals with distinct frequency relationships are applied to the dual-polarization dual-parallel Mach–Zehnder modulator. By adjusting the power of the applied sinusoidal radio frequency signal, the power ratio between these orthogonal polarized optical sidebands can be changed, and thereby desired radio frequency waveforms can be obtained after photoelectric conversion. In our proof-of-concept experiment, we systematically varied the repetition rate of triangular, rectangular and sawtooth waveforms. Meanwhile, we calculated the Root Mean Square Error (RMSE) to assess the approximation error in each waveform. The RMSEs are 0.1089, 0.2182 and 0.1185 for the triangular, rectangular and sawtooth microwave waveforms with repetition rate of 8 GHz, respectively. Furthermore, after passing through 25 km single mode fiber, the optical power decreased by approximately 5.6 dB, which verifies the anti-dispersion transmission capability of our signal generator.