MATLAB: How to generate pulses with 180 deg phase shift

simpowersystems

i require 4 pulses for full bridge inverter. In one leg with out phase delay and on other leg with phse delay if 180 deg. here fs=60khz so ts=1/60000 dead time =0.5e-6 first leg phase shift= 0 here i generate two signals using pulse generator.now i require two pulses for 2nd leg with phase shift of 180 deg

Best Answer

A phase shift is equivalent to multiplication by a complex exponential in frequency domain. Take an fft of the whole signal and multiply each component (as a complex number) by the complex number cos(p) + i * sin(p) where p is the phase-shift given in radians. Afterwards take the inverse transform and you are done.