from siggens import PRN_bitstreams as prn from utils import freqaxis_shape as ut from correlators import corrCUDA as corcud from correlators import corrMKL as cormkl from correlators import corrNumpy as cornp ##################### Parameters ###################### f_sampl = 50e3 # sampling frequency in kHz T_int = 0.5 # entire signal length in ms ##################### Simulation ###################### t = np.arange(0, T_int, 1 / f_sampl) # time axis f = ut.freq_fr_time(t) # frequency axis tc = ut.corr_fr_time(t) # correlation time axis cd = prn.gold_seq(3, 5, no_bits=500) # code Ts = 10e-3 # Nyquist's symbol interval tau = 0.3 # time acceleration factor Tstr = Ts * tau # transmitted symbol interval td = 0.05 # initial delay of the sequence (time offset) # Time Domain a1 = gen.rcos_tr(t, Tstr, td + Tstr / 2, cd, Ts, 1.0) #c = gen.rect_tr(t,Tstr,0,td,cd) print("Length of the signal", np.size(a1)) print(60 * '-') print('CUDA correlator') print(60 * '-') p = profiler.Profile(signatures=False)
#!/usr/bin/env python """ This is a test bed script to plot a bitsteam with its symbols shaped. """ import sys sys.path.append("../../sim") import numpy as np import scipy.signal as signal import matplotlib.pyplot as plt from siggens import train_pulse as gen from siggens import PRN_bitstreams as prn from utils import freqaxis_shape as ut from modulators import constallation_mappers as mod from modulators import up_convertors as upcon cd = prn.gold_seq(3,7,1,test=1,test_rep=50) cd.tofile("code_PRN1.txt",format='%d',sep=',')
import numpy as np import scipy.signal as signal import matplotlib.pyplot as plt from siggens import train_pulse as gen from siggens import PRN_bitstreams as prn from utils import freqaxis_shape as ut ##################### Parameters ###################### f_sampl = 50e3 # sampling frequency in kHz T_int = 30 # entire signal length in ms ##################### Simulation ###################### t = np.arange(0,T_int,1/f_sampl) # time axis f = ut.freq_fr_time (t) # frequency axis tc = ut.corr_fr_time (t) # correlation time axis cd = prn.gold_seq(3,5,no_periods = 3) # code Ts = 10e-3 # Nyquist's symbol interval tau = 0.3 # time acceleration factor Tstr = Ts * tau # transmitted symbol interval td = 0.05 # initial delay of the sequence (time offset) # Time Domain a1 = gen.rcos_tr(t,Tstr,td + Tstr/2,cd,Ts,1.0) #c = gen.rect_tr(t,Tstr,0,td,cd) print ("Length of the signal", np.size(a1)) # Correlate processor #ts = timer() #A1_c = signal.correlate(a1,a1,'full') #C1_c = signal.correlate( c,a1,'full')
from siggens import PRN_bitstreams as prn from utils import freqaxis_shape as ut from modulators import constallation_mappers as mod from modulators import up_convertors as upcon ##################### Parameters ###################### f_sampl = 900e6 # sampling frequency in Hz T_int = 0.005115 # entire signal length in s ##################### Simulation BASEBAND ###################### t = np.arange(0, T_int, 1 / f_sampl) # time axis #f = ut.freq_fr_time (t) # frequency axis #cd = np.array([1,1,1,0,1,1,1,1,0,1,0,0,1,0,1]) # code x1 = 2 # tap 1 to generate G2 in goldcode generator x2 = 6 # tap 2 to generate G2 in goldcode generator cd = prn.gold_seq(x1, x2, 1) Tstr = 5e-6 # Nyquist's symbol interval tau = 0.35 # time acceleration factor Ts = Tstr / tau # transmitted symbol interval bitrate = 1 / Tstr td = 0.0 # initial delay of the sequence (time offset) # baseband signals a1 = mod.rcos_bpsk_map(t, cd, bitrate, pw=Ts, alpha=1.0, td=Tstr / 2) a2 = mod.rcos_bpsk_map(t, cd, bitrate, pw=Ts, alpha=0.5, td=Tstr / 2) a3 = mod.rcos_bpsk_map(t, cd, bitrate, pw=Ts, alpha=0.0, td=Tstr / 2) c = gen.rect_tr(t, Tstr, 0, td, cd) ##################### Simulation PASSBAND ###################### fc = 60e6 # carrier frequency in Hz
import numpy as np import scipy.signal as signal import matplotlib.pyplot as plt from siggens import train_pulse as gen from siggens import PRN_bitstreams as prn from utils import freqaxis_shape as ut ##################### Parameters ###################### f_sampl = 50e3 # sampling frequency in kHz T_int = 10.23 # entire signal length in ms ##################### Simulation TAU = 1 ###################### t = np.arange(0, T_int, 1 / f_sampl) # time axis #f = ut.freq_fr_time (t) # frequency axis tc = ut.corr_fr_time(t) # correlation time axis cd = prn.gold_seq(2, 6, 1) # code tau = 1 # time acceleration factor Ts = 10e-3 # transmitted symbol interval Tstr = Ts * tau # Nyquist's symbol interval td = 0 # initial delay of the sequence (time offset) # Time Domain a1 = gen.rcos_tr(t, Tstr, td + Tstr / 2, cd, Ts, 1.0) a2 = gen.rcos_tr(t, Tstr, td + Tstr / 2, cd, Ts, 0.5) a3 = gen.rcos_tr(t, Tstr, td + Tstr / 2, cd, Ts, 0.0) c = gen.rect_tr(t, Tstr, 0, td, cd) # Correlate processor A1_c = signal.correlate(a1, a1, 'full') A2_c = signal.correlate(a2, a2, 'full')