* Select sample rate based on device type and requested samples-per-symbol. * The base rate is either GSM symbol rate, 270.833 kHz, or the minimum * usable channel spacing of 400 kHz. */
| 101 | * usable channel spacing of 400 kHz. |
| 102 | */ |
| 103 | static double select_rate(uhd_dev_type type, int sps) |
| 104 | { |
| 105 | if ((sps != 4) && (sps != 1)) |
| 106 | return -9999.99; |
| 107 | |
| 108 | switch (type) { |
| 109 | case USRP2: |
| 110 | return USRP2_BASE_RT * sps; |
| 111 | case B100: |
| 112 | return B100_BASE_RT * sps; |
| 113 | case B2XX: |
| 114 | case UMTRX: |
| 115 | return GSMRATE * sps; |
| 116 | default: |
| 117 | break; |
| 118 | } |
| 119 | |
| 120 | LOG(ALERT) << "Unknown device type " << type; |
| 121 | return -9999.99; |
| 122 | } |
| 123 | |
| 124 | /** Timestamp conversion |
| 125 | @param timestamp a UHD or OpenBTS timestamp |