Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getBit(byteArray, bitNumber):
- "This returns bit with bitNumber position from byteArray"
- byte = byteArray[bitNumber // 8]
- return (byte >> (bitNumber % 8)) & 1
- while True:
- multiChannelSample = inputFile.read(2)
- if multiChannelSample == b'':
- break
- for channel in range(0, 16):
- singleChannelSample = '+1' if (getBit(multiChannelSample, channel)) else '-1'
- outputFiles[channel].write(singleChannelSample + '\n')
- sampleCounter += 1
Advertisement
Add Comment
Please, Sign In to add comment