Test and Measurement Forum

Downsampling

Post general discussions on using our drivers to write your own software here

Downsampling

Postby IonutGorgos » Tue Jun 14, 2016 2:39 pm

Hello,

I have a PicoScope 6404D, and currently I'm developing a script written in Python using PicoPython from this source:
https://github.com/colinoflynn/pico-python

My problem is with the downsampling. I will attach some photos to explain.
In this photo
10 bits - picoscope 6.png

I have the signal on the channel A with the 10.0 bits resolution ( 2.0 bits --> 16 number of values). Sample interval is 3.2 ns and the no. of samples captured is 625.

When I import in Matlab the signal look like this
10 bits - picoscope_matlab.png
which is fine.

Now the problem is when I'm using the API functions from DLL with Python.
I set the observation duration ( 2 µs in my case) , the sampling interval at 3.2 ns , channels, trigger. Then I'm calling the RunBlock() function and retrieve the values with downSampleMode = 2 (Average) and downSampleRatio = 16 (2.0 bits resolution enhancement) and then save them in .mat file. Now my no. of samples is 39, not 625. Here is the photo
10 bits - python_matlab_fig.png


I tried to increase the observation duration (16*2 µs) , but my plot is looking different :
10 bits_python_no_samples.png


I don't know what to do. Please help me. Thanks in advance.

Ionut
IonutGorgos
Newbie
 
Posts: 0
Joined: Tue Jun 14, 2016 2:10 pm

Re: Downsampling

Postby hexamer » Wed Jun 15, 2016 2:09 am

The results you are getting from the API make sense to me. It is a form of downsampling, so per the documentation it is expected to be 625 / 16 = ~39 samples.

I think the confusion (and apparently it's not uncommon) is that the PicoScope App is implementing a rolling average for the resolution enhancement, so it's not reducing the number of samples (downsampling). Though it may really be reducing the "effective" sample rate. Even though an averaging feature is available in the API, it's a block average with downsample, not rolling. See: topic21121.html?hilit=resolution%20enhancement#p67491

As pointed out in that thread, it should be pretty easy to implement a rolling average. You'd have to capture 16 more samples to be able to compute a 625 sample rolling average.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Downsampling

Postby IonutGorgos » Wed Jun 15, 2016 5:17 pm

Yeap, i get it. Thank you very much.
IonutGorgos
Newbie
 
Posts: 0
Joined: Tue Jun 14, 2016 2:10 pm

Re: Downsampling

Postby IonutGorgos » Thu Jun 16, 2016 4:39 pm

Hello,

Actually I realised this is not what I want.

What we need is to use the downsampling method from the API, so that we use the full sampling rate of the oscilloscope (e.g. 2.5GS/s for two channels, or 5GS/s for one channel) and then apply the hardware downsampling to increase the resolution of the data we obtain.

For example, if we want to use 10-bit resolution then we expect to obtain 2.5/16 ~ 156 MS/s after the downsample. However, these sampes are high-res, i.e. they come from averaging each 16 real sample at full sampling rate into one returned high-res sample.

We are not sure if the PicoScope software does this when using the High-res feature or just a moving average, but from the API documentation it seems possible. In particular, it is clearly mentioned in this page:
https://www.picotech.com/library/oscill ... nhancement

the following paragraph:
"Consider a PicoScope 6404 oscilloscope with a 500 MHz bandwidth and 5 GS/s sampling rate. If you enable 2 bits of resolution enhancement the effective sampling rate is reduced from 5 GS/s to 312.5 MS/s. The current sampling rate and level of resolution enhancement are displayed in the properties pane and it is advisable to check these when using the feature."

We are using precisely a 6404D oscilloscope. However, in the properties pane, when using the resolution enhancement, the effective sampling rate is not shown. Instead, we always see the same full sampling rate of 2.5GS/s for two channels. Furthermore, from the properties pane and from the returned waveform, it is clear that the total number of samples has not decreased, i.e. we still get 5000 samples in our case (400ps sampling interval, 2us total interval), even after using 10-bit resolution enhancement. This is not as expected and is not what it says on the webpage mentioned above. See the attached images, where for both 8-bit resolution or 10-bit resolution enhancement we get the same sampling rate and the same number of samples.
8 bits.png
8bits


10 bits.png
10bits



Could you please clarify this issue? That is, how to use the resolution enhancement method presented in the webpage?


In any case, we would like to use the resolution-enhancement feature as shown in the page mentioned above. Is this possible ?
IonutGorgos
Newbie
 
Posts: 0
Joined: Tue Jun 14, 2016 2:10 pm

Re: Downsampling

Postby Martyn » Tue Jun 21, 2016 9:53 am

Resolution enhancement is a purely software feature in PicoScope 6, it does not use the hardware down sampling available in the scope. The number of samples collected, and displayed, will remain the same.

If you enable 2 bits of resolution enhancement the effective sampling rate is reduced from 5 GS/s to 312.5 MS/s.

This statement is intended to indicate that the resultant waveform will have a vertical resolution of 10bits, but the edges of the signal will appear as if the signal was sampled at 312.5MS/s even though samples are actually taken at 5GS/s
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2280
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests