f0 = 2e9 tinitial = 3 / f0 / 4 # system transfer function H = lambda f: np.exp(-f**2.0 / f0**2.0 / 2) # Signal constellation c = cl.pam_constellation(16, title='16-PAM') # Plot PAM constellation plt.close('all') c.plot() c.plot_map() # set bits to be transmitted bits = cl.random_bits(32) # build input waveform and plot x = cl.digital_signal(TS=TS, samples_per_symbol=samples_per_symbol, tinitial=tinitial, tguard=tguard, constellation=c, fcarrier=f0) x0 = cl.digital_signal(TS=TS, samples_per_symbol=samples_per_symbol, tinitial=tinitial, tguard=tguard, constellation=c, fcarrier=0)
import commlib as cl import matplotlib.pyplot as plt M = 4 TS = 1e-9 samples_per_symbol = 200 f0 = 2e9 Nbits = 8 c = cl.psk_constellation( M = M ) x = cl.digital_signal( TS = TS, samples_per_symbol = samples_per_symbol, constellation = c, fcarrier = f0 ) bits = cl.random_bits( Nbits ) x.modulate_from_bits( bits ) x.plot( close_all = True ) plt.grid()