mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 11:19:18 +00:00
change the packets per sample calculation for 2-bit files.
This is complicated and I botched it before. Hopefully someone with access to 2-bit samples can test this
This commit is contained in:
parent
ecc339e68b
commit
06d1d2773b
@ -99,9 +99,16 @@ std::tuple<size_t, bool> TwoBitPackedFileSignalSource::itemTypeToSize()
|
||||
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
|
||||
// If the item_type() is short, then the size is 16/2 = 8 packets per sample
|
||||
double TwoBitPackedFileSignalSource::packetsPerSample() const { return item_size() / 2.0; }
|
||||
// item_size() reports in bytes. Each sample is 2 bits, so the size is 8/2 = 4 packets per
|
||||
// byte times the size of each item. A complex file has I and Q interleaved, so there are
|
||||
// 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_; }
|
||||
|
||||
void TwoBitPackedFileSignalSource::create_file_source_hook()
|
||||
|
Loading…
Reference in New Issue
Block a user