Test and Measurement Forum

Values in Matlab export

Forum for discussing PicoScope version 6 (non-automotive version)

Values in Matlab export

Postby chris_bore » Thu Dec 08, 2011 3:08 pm

When saving data as Matlab files, what is the maximum genuine value (values seem to saturate at +/-Inf and to be saved as doubles).
Posts: 0
Joined: Thu Dec 08, 2011 2:28 pm

Re: Values in Matlab export

Postby Hitesh » Thu Dec 08, 2011 3:48 pm

Hi Chris,

Which PicoScope device are you using?

The values returned by the driver will be 16-bit integers - when loaded into the MATLAB, these values will be converted into the default double data type.

As these are 16-bit ADC count values, the max/min values in ADC counts should be +/- 32767. Depending on the voltage range used, these values will be scaled accordingly to convert into milliVolts. The following code snippet from the 3000A series C example should demonstrate this:

Code: Select all
int adc_to_mv(long raw, int ch, UNIT * unit)
        if(scaleVoltages == 1)
         return (raw * inputRanges[ch]) / unit->maxValue;
             return raw;

In the function arguments, raw is the raw ADC value, ch is the index used to determine the voltage range used, and unit is a structure used to hold information about the device.

There is a function call that returns the maximum value for a device, in ADC counts, for a device in the 3000A series API. For the PicoScope 3204B, this is 32512. Anything above this is likely to be returned as invalid number - it may be that MATLAB treats these as an infinite number.

If you have an example file you could send to support@picotech.com, we can take a look.


Technical Support Engineer
Site Admin
Site Admin
Posts: 2749
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to PicoScope 6 for Windows

Who is online

Users browsing this forum: No registered users and 0 guests