I'm using a Picolog 1216. When collecting data from the Picolog the voltage resolution is around 0.5mV which is limited by the different between integer adc counts. However, with the PicoLog 6 software the resolution is much higher. How is this the case and how would I get a similar precision from data collected in MatLab?
In the PicoLog software the data is quoted to the nearest 0.001 mV. For example in a set of data that I took the first two values were 0.914608 V and 0.914609 V. When using Matlab to collect data, the maximum ADC value for the Picolog 1216 is 4095 so the resolution of the data is set by 1x2.5/4095=0.6 mV and this is reflected in the data.
The increased resolution that you are referring to is due to the averaging of the waveform by the selected Sample Mode for the channel. The averaging process changes the individual quantised values used in the calculation to a statistical composite value that is not bound by the sampling process. You will see that if you select Latest Sample the resolution goes back to what you have in Matlab.
The effect can be explained by an analogy. If you look at the printing process of Newspapers where the printing press is monochrome only, with just black dots they are able to print intermediate shades of grey which depend upon the concentration of the black dots. So, when displaying averaged sample values we are able to display intermediate values which depend upon the concentraion of values around a mean.
The effect in PicoLog 6 is similar to the Resolution Enhancement done in PicoScope 6 channels, with the exception that it is more of a stepping average, while Res Enhance is more of a rolling average (so PicoLog averaging also reduces the number of samples, while Res Enhance doesn't). So if you want to reproduce it in Matlab you can just average each number of samples into 1 value, or you can go one better and perform your own Resolution Enhancement (without downsampling the data at the same time) by replacing every sample value with the average of a number of samples around it.
I'd like to follow this question since I have the similar confusion. I'm trying to measure the same signal with both matlab and my picoscope 5443D with the same settings (8 bits, 125 MS), and the PS graph is captured from my instant signal from channel B, not the average one. However, the results look quite different as I attached below. It looks like the noise in matlab is much larger and I can not see my echo signal in it. I'm wondering if you have any suggestions for it? Thanks so much.
Thanks for your reply. I've attached my psdata file in the reply and it looks like there are some problems with my Matlab code and I've figured it somehow. However, I do have another two questions about Matlab streaming data collection and I'm wondering if you could help.
1) I've read the API programmer's guide on another topic and it says the streaming mode is directly writing the data into the PC. I'm now trying to collect data with a high sampling rate (125 MS). While for a 4s streaming, it takes over an hour for the collection, I'm wondering during this period, where is my data stored and if the result is credible?
2) In the PicoScope 6, I can get a sampling rate high to 500 MS for two channels in my 5443D and 1 GS for one channel. While in the Matlab, I cannot adjust the streaming interval lower than 8e-9(125 MS) even under 8 bits resolution, I'm wondering why this would happen and can we change this?
1/ Streaming is way of transferring the data to the computer, effectively in real-time, as it is being acquired by the hardware PicoScope. When streaming data to the PC, the data is transferred to the buffer in the Driver. It is the responsibility of your application code to transfer it from the Driver buffer to the buffer that you have created for your application code, and you need to be doing this at a rate that is faster than the rate that the data is transferred to the Driver buffer to avoid data loss (the Driver is a circular buffer, so it will overwrite old data with new data once the buffer is full). So, if you are doing that correctly then 4s of streaming should take only slightly longer than 4s to acquire all of the data, and the data should be in the buffer that you have transferred it to.
2/ In PicoScope 6, Streaming is referred to as 'Slow Sampling Mode', and the fastest Timebase that you can use is, by default 100ms/div. So, you will only get relatively slow sample rates when streaming in PicoScope 6 and also when streaming in Matlab. This is because, at faster data rates, the data is arriving too quickly to be able to reliably transfer it over USB and process it on the computer, all in real-time. (Note that you can tell when you are in Slow Sampling Mode in PicoScope 6, because, with an empty graph, you will see the waveform being drawn as the data is being collected).
So, at faster rates (such as 500MS/s and 1GS/s) the hardware PicoScope needs to wait until it has acquired all of the data before transferring to to the computer. These faster sample rates are referred to as 'Fast Sampling Mode' in PicoScope 6, which is referred to as 'Block Mode' in the Programmers Guide (and also 'Rapid Block Mode' and 'ETS Mode').
Thanks so much for your explanation. I'm having one more question that may need your help with. One thing I found in my final data in channelBFinal (PS5000A_ID_Streaming_Example) is that the data is defined as int16 type (1 mV) which kind of too low resolution for me since my signal is usually several mV to several tens of mV. I'm trying to change the pDriverBufferChA and pAppBufferChA type from int16 to single. But it turns out that it will also affect other functions which I don't really understand with the following instructions:
Error using privateExecuteMCode (line 44)
Pointer types must match data type.
Error in instrgate (line 20)
[varargout{1:nout}] = feval(varargin{:});
Error in PS5000A_ID_Streaming_Example (line 202)
status.setDataBufferChA = invoke(ps5000aDeviceObj, 'ps5000aSetDataBuffer', ...
I'm wondering how we can solve this. One way I'm thinking about is to use another array to collect the bufferChBmV values, which looks like double type data (I'm not sure as it's collecting data from pAppBufferChA, which should still be int16?). In addition, it will also double the capacity I need. Do you have any suggestions for this? Thanks so much!