This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLPNIRSCANEVM: Scandata

Part Number: DLPNIRSCANEVM

Hi,

I get a series of data from NIR through bluetooth, some of which are as follows:

(0x) 00-EE-0E-00-00

(0x) 01-74-70-6C-00-75-0E-00-00-53-28-75-63-23-63-63-63-63-63-63

(0x) 02-63-6A-6A-76-76-75-24-28-66-23-66-23-29-63-23-76-63-63-63

(0x) 03-63-76-63-23-63-23-76-76-63-76-76-69-23-29-00-14-00-00-00

(0x) 04-03-00-00-00-03-00-00-00-08-00-00-00-08-00-00-00-28-00-00

(0x) 05-00-60-03-00-00-01-00-00-00 -67-6E-6F-68-6E-69-4C-00-00-00

(0x) 06-00-00-00-00-00-00-00-00-00-00 -0F-03-1F-02-07-01-23 -DA-0B

(0x) 07-3E-0B -74-13 -06-0E -01-00-F1-00 -80-72-D2-74-75-98-1F-C0-46

(0x) 08-67-A2-83-2C-BF-B0-3F-02-0A-E5-5E-89-C0-21-BF-31-13-6C-F2

(0x) 09-50-73-9B-40-F7-7C-93-C0-92-71-ED-BF-60-BA-22-35-16-53-30

(0x) 0A-BF-36-34-36-30-30-32-37-00-ED-00-18-19-40 -00-4D-00-36-34

(0x) 0B-36-30-30-32-37-00 -43-6F-6C-75-6D-6E-20-31-00-00-00-00-00

(0x) 0C-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

(0x) 0D-00-00-00-00-00-00-00-00 -84-03-A4-06 -06 -E4-00 -06-00 -61-B8

(0x) 0E-00-00-F9-C4-00-00-46-D2-00-00-A1-DE-00-00-9C-F1-00-00-3D

(0x) 0F-05-01-00-55-17-01-00-72-2A-01-00-F9-3D-01-00-A9-4E-01-00

...

They are packets of data. Is the next thing I need to do to remove the header from the packet and then do the next deserialization?

Should I write this data into an array? Then deserialize the array into a structure.

Now I have a lot of questions, hope to get help.

Thanks & Regards,

Hong.

  • Hello Hong,

    Please let us look into this and we plan to get back to you this week.

    Thanks,

    Kyle

  • Hi Hong, 

    You have to take only the scan data blob payload and reject the other parts of received data. After you assemble the whole data blob, you can then use the interpret function to get the scan results. Kindly follow flowchart 5-13 on NIRScan Nano user guide to read the scan data from the NIRScan Nano.

    Thanks & Regards,

    Hirak.

  • Hi Hirak,

    I found a scanData structure inside the dlp_scan_interpret() function, which defines an int32_t adc_data[ADC_DATA_LEN]. Excuse me, is the ADC sampling value after scanning stored in this array?Is that 8 bytes for a sampling wavelength?

    Thanks & Regards,

    Hong.

  • Hi Hirak,

    After a lot of debugging, I am a bit suspicious about my data. Hirak, can you provide me with a test data?

    Thanks & Regards,

    Hong.

  • Hi Hong, 

    Kindly find attached a serialized scan data blob obtained from NIRScan Nano in a .dat format. You can use this data for deserialization and interpretation trial. 

    Thanks & Regards,

    Hirak.

    002E0002.DAT

  • Hi Hirak,

    I found the code for calculating the light intensity in the DLP Spectrum Library, but I don't understand it very well. Could you please explain to me in detail how to calculate the light intensity through sampling data? or give me a document about it.

    Thanks & Regards,

    Hong.

  • Hi Hong,

    You can use the dlpspec_deserialize() function to deserialize the scan data blob to get a scandata structure. In this structure you will find the raw ADC values. I think by light intensity you mean the obtained ADC values. Kindly find the definition of the scandata structure in the file dlpspec_scan.h file. 

    Thanks & Regards,

    Hirak.

  • Hi Hirak,

    I've got the raw ADC value,and here's the code

        /* Compute DC detector level during black patterns */
        for(i=0; i<pScanData->adc_data_length; i++)
     {
            if((i-pattern_first)%pattern_period == 0)
            {
          dc_level += pScanData->adc_data[i];
          num_black_patterns++;
            }
     }
     if(num_black_patterns > 0)
      dc_level /= num_black_patterns;

        /* Subtract found DC detector level from remaining measurements */
        for(res_idx=0, scan_idx=0; scan_idx < pScanData->adc_data_length;)
     {
      if((scan_idx-pScanData->black_pattern_first)
        %pScanData->black_pattern_period == 0)
      {
       scan_idx++; //skip this adc_data (black level)
      }
      else
      {
       pResults->intensity[res_idx] = pScanData->adc_data[scan_idx++] - dc_level;
       res_idx++;
      }
     }

    This is how we calculate the intensity of the light by adc_data,but I don't know why we do that.

    Can you give me some inspiration?

    Thanks & Regards,

    Hong.

  • Hi Hong,

    Please review the "Texas Instruments DLP® Spectrometer Design Considerations" application note section 4 on algorithm for details of scan procedure.

    http://www.ti.com/lit/an/dlpa049/dlpa049.pdf

    The software scan 24 patterns at time and for every batch of 24 pattern, it also scan a black pattern. This black pattern measures the stray light in the system.  The average value of black pattern (DC level) is subtracted from from the intensity for each wavelength.

    regards,

    Vivek

  • Thank you Vivek, it's very useful for me.