Created
          May 19, 2019 19:28 
        
      - 
      
- 
        Save kbeckmann/6db25501ff02c46e79143c0ed1c47d88 to your computer and use it in GitHub Desktop. 
    Convert RAW iq samples to SDRAngel "sdriq" format
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import sys | |
| import struct | |
| import binascii | |
| # See https://github.com/f4exb/sdrangel/tree/master/plugins/samplesource/filesource | |
| data = open(sys.argv[1], "rb").read() | |
| out = open(sys.argv[2], "wb") | |
| w = bytearray() | |
| w += struct.pack("<I", 500000) # Sample rate | |
| w += struct.pack("<Q", 868000000) # Center freq Hz | |
| w += struct.pack("<Q", 0) # Timestamp | |
| w += struct.pack("<I", 16) # Sample size 16 or 24 ? | |
| w += struct.pack("<I", 0) # Padding | |
| out.write(w) | |
| out.write(struct.pack("<I", binascii.crc32(w))) # CRC32 | |
| out.write(data) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment