mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Merge branch 'two-bit-sample-size' of https://github.com/jwmelto/gnss-sdr into jwmelto-two-bit-sample-size
This commit is contained in:
		| @@ -99,9 +99,19 @@ std::tuple<size_t, bool> TwoBitPackedFileSignalSource::itemTypeToSize() | |||||||
|     return std::make_tuple(item_size, is_complex_t); |     return std::make_tuple(item_size, is_complex_t); | ||||||
| } | } | ||||||
|  |  | ||||||
| // Each sample is 2 bits; if the item_type() is char, then the size is 8/2 = 4 packets per sample | // item_size() reports in bytes. Each sample is 2 bits, so the size is 8/2 = 4 packets per | ||||||
| // If the item_type() is short, then the size is 16/2 = 8 packets per sample | // byte times the size of each item. A complex file has I and Q interleaved, so there are | ||||||
| double TwoBitPackedFileSignalSource::packetsPerSample() const { return item_size() / 2.0; } | // half as many (complex) samples as float | ||||||
|  | double TwoBitPackedFileSignalSource::packetsPerSample() const | ||||||
|  | { | ||||||
|  |     auto packets = item_size() * 4.0; | ||||||
|  |     if (is_complex()) | ||||||
|  |         { | ||||||
|  |             packets /= 2; | ||||||
|  |         } | ||||||
|  |     return packets; | ||||||
|  | } | ||||||
|  |  | ||||||
| gnss_shared_ptr<gr::block> TwoBitPackedFileSignalSource::source() const { return char_to_float_; } | gnss_shared_ptr<gr::block> TwoBitPackedFileSignalSource::source() const { return char_to_float_; } | ||||||
|  |  | ||||||
| void TwoBitPackedFileSignalSource::create_file_source_hook() | void TwoBitPackedFileSignalSource::create_file_source_hook() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez