Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Tue Dec 10 14:16:22 2019
  4.  
  5. @author: usbo2
  6. """
  7.  
  8. import numpy as np
  9. import scipy as sp
  10.  
  11. def concatenate_bin(x):
  12.    return( (x[0] << 3*8) + (x[1] <<2*8 ) + (x[2] << 1*8)  + (x[3] ) )
  13.  
  14. a=np.random.randint(-128,128,1000)
  15. ra=a.reshape((int(len(a)/4),4 ))
  16.  
  17. res=concatenate_bin(ra)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement