I found this code in a book to generate polar RZ for a bpsk modulation, if someone can explain to me how the upfirdn function is used here to generate it:
Function to modulate an incoming binary stream using BPSK (baseband)
def bpsk_mod(ak,L):
#ak : input binary data stream (0's and 1's) to modulate
#L : oversampling factor (Tb/Ts)
from scipy.signal import upfirdn
s_bb = upfirdn(h=[1]*L, x=2*ak-1, up
= L) # NRZ encoder
t=np.arange(start = 0,stop =
len(ak)*L) #discrete timebase
return (s_bb,t)