Get the number of bytes per I+Q sample. Parameters ---------- data_type : str The data type of the bytes. Returns ------- int The number of bytes per I+Q sample.
(data_type)
| 49 | |
| 50 | |
| 51 | def get_bytes_per_iq_sample(data_type): |
| 52 | """ |
| 53 | Get the number of bytes per I+Q sample. |
| 54 | |
| 55 | Parameters |
| 56 | ---------- |
| 57 | data_type : str |
| 58 | The data type of the bytes. |
| 59 | |
| 60 | |
| 61 | Returns |
| 62 | ------- |
| 63 | int |
| 64 | The number of bytes per I+Q sample. |
| 65 | """ |
| 66 | if data_type == "cf32_le" or data_type == "cf32" or data_type == "cf32_be": |
| 67 | return 8 |
| 68 | elif data_type == "ci16_le" or data_type == "ci16" or data_type == "ci16_be": |
| 69 | return 4 |
| 70 | elif data_type == "ci8" or data_type == "i8": |
| 71 | return 2 |
| 72 | else: |
| 73 | raise ValueError("Datatype " + data_type + " not implemented") |
no outgoing calls
no test coverage detected