snrSize = int(raw_input('Enter size of SNR array: '))
snrArray = raw_input('Enter SNR array: ').split()

for i in range(snrSize):
	snrArray[i] = int(snrArray[i])

digitalInput_X1 = []
for i in range(inputSize):
	digitalInput_X1.append(randint(0,1))

digitalInput_X2 = []
for i in range(inputSize):
	digitalInput_X2.append(randint(0,1))

# Output of Transmitter
transmitSignal_X1, transmitSignal_X2 = transmitter(digitalInput_X1, digitalInput_X2, inputSize)

#Output after impulse convolution
#hValue = random.randn(2,2)
hValue = array([[0.4,0.9],[0.5,0.8]])
convolved_X1, convolved_X2 = multiplethreading(transmitSignal_X1, transmitSignal_X2, hValue)

# Output after noise addition
noisedSignal_X1, noisedSignal_X2 = NoiseChannel(convolved_X1, convolved_X2, inputSize, snrArray, snrSize)

# Signal received at receiver and demodulated
receivedSignal_X1, receivedSignal_X2 = receiver(noisedSignal_X1, noisedSignal_X2, len(noisedSignal_X1), len(noisedSignal_X2), hValue)

t = []
for i in xrange(len(receivedSignal_X1)/inputSize):
	t.append(receivedSignal_X1[i*inputSize:((i+1)*inputSize)])
Beispiel #2
0
snrSize = int(raw_input('Enter size of SNR array: '))
snrArray = raw_input('Enter SNR array: ').split()

for i in range(snrSize):
    snrArray[i] = int(snrArray[i])

digitalInput_X1 = []
for i in range(inputSize):
    digitalInput_X1.append(randint(0, 1))

digitalInput_X2 = []
for i in range(inputSize):
    digitalInput_X2.append(randint(0, 1))

# Output of Transmitter
transmitSignal_X1, transmitSignal_X2 = transmitter(digitalInput_X1,
                                                   digitalInput_X2, inputSize)

#Output after impulse convolution
#hValue = random.randn(2,2)
hValue = array([[0.4, 0.9], [0.5, 0.8]])
convolved_X1, convolved_X2 = multiplethreading(transmitSignal_X1,
                                               transmitSignal_X2, hValue)

# Output after noise addition
noisedSignal_X1, noisedSignal_X2 = NoiseChannel(convolved_X1, convolved_X2,
                                                inputSize, snrArray, snrSize)

# Signal received at receiver and demodulated
receivedSignal_X1, receivedSignal_X2 = receiver(noisedSignal_X1,
                                                noisedSignal_X2,
                                                len(noisedSignal_X1),

inputSize = int(raw_input('Enter the size of the input: '))
hValue = float(raw_input('Enter value of convolution impulse: '))
snrSize = int(raw_input('Enter size of SNR array: '))
snrArray = raw_input('Enter SNR array: ').split()

for i in range(snrSize):
	snrArray[i] = int(snrArray[i])

digitalInput = []
for i in range(inputSize):
	digitalInput.append(randint(0,1))

# Output of Transmitter
transmitSignal = transmitter(digitalInput, inputSize)

#Output after impulse convolution
convolved = h(transmitSignal, hValue)

# Output after noise addition
noisedSignal = NoiseChannel(convolved, inputSize, 				snrArray, snrSize)
#print noisedSignal

# Signal received at receiver and demodulated
receivedSignal = receiver(noisedSignal, len(noisedSignal),hValue)
#print receivedSignal, len(receivedSignal)
#print digitalInput
# Error per SNR calculations
err = []
for i in range(len(noisedSignal)):