Jump to content

Alex D

QRC User
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alex D

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Alex D

    QVRT Context packet Metadata Timestamp

    You are correct in the fact that the packets can go [ A B A B] or any combination. For example [A A B A] is valid depending on the file. This is due to the fact that tuners A and B may not be set at the same sample rate causing more samples for one or the other in the same time frame. Each iterator is independent of the other and only handles packets assigned to that particular stream. If you read one packet for A and then one packet for B, if the sample rates are different, you will become out of time. In order to make sure the file iterators stay in time, you must read samples in relation to the specific radio's sample rate. For example, if radio A has a sample rate of 10MS/s and radio B has a sample rate of 20MS/s for a combined sample rate of 30MS/s, you would need to read 10,000,000 samples for the iteratorA and 20,000,000 samples for the iteratorB to read in 1 second of data. These values can be reduced to meet your needs but, the ratio of samples must stay consistent. I hope this helps clear up how the QVRT files work.
  2. Alex D

    QVRT Context packet Metadata Timestamp

    If you would like to iterate over a specific amount of time, I would do the following: while(...) { ... while(iteratorA.getCurrentPacketType() != VRT_IF_DATA && !iteratorA.isEndOfStream()) { iteratorA++; } while(iteratorB.getCurrentPacketType() != VRT_IF_DATA && !iteratorB.isEndOfStream()) { iteratorB++; } totalSamples += iteratorA.getCurrentIQDataFloat(buffer, sampleRateA * desiredDuration * 2, WbtVRTFileReadIterator::Wbt_Samples_Continued_From_Last); // process buffer data totalSamples += iteratorB.getCurrentIQDataFloat(buffer, sampleRateB * desiredDuration * 2, WbtVRTFileReadIterator::Wbt_Samples_Continued_From_Last); // process } This will allow you to keep the temporal integrity. Wbt_Samples_Continued_From_Last will return all the samples you need for each time span. The sample rate needs to be checked for each tuner or else you can get out of time. As far as the meta data, it depends on what you need from it. Does the information in one tuner's meta data contain the information you need?
  3. Alex D

    QVRT Context packet Metadata Timestamp

    The following is sample code for getting samples for a combined tuner QVRT file. void process(WbtCommon::Data::FileInfo file) { WbtVRTFileReadIterator iteratorA(file._fileName, WbtCommon::Data::Radio_A); WbtVRTFileReadIterator iteratorB(file._fileName, WbtCommon::Data::Radio_B); const int samplesPerSecond = file._radioSettings._combined._span * 1e6L; const int valuesPerChunk = 33*995*2; qint64 totalASamples = 0; qint64 totalBSamples = 0; float* buffer = new float[valuesPerChunk]; while(iteratorA.isValid() && !iteratorA.isEndOfStream()) { if(iteratorA.getCurrentPacketType() == VRT_IF_DATA) { totalASamples += iteratorA.getCurrentIQDataFloat(buffer, valuesPerChunk); //Do work with buffer data } iteratorA++; } while(iteratorB.isValid() && !iteratorB.isEndOfStream()) { if(iteratorB.getCurrentPacketType() == VRT_IF_DATA) { totalBSamples += iteratorB.getCurrentIQDataFloat(buffer, valuesPerChunk); //Do work with buffer data } iteratorB++; } int combinedSeconds = (totalASamples + totalBSamples) / samplesPerSecond; delete[] buffer; }
  4. Alex D

    QVRT Context packet Metadata Timestamp

    Just updating you that we are working on a fix for the issue.