Search found 8 matches

by Anders_Eriksson
Wed Apr 15, 2020 2:32 pm
Forum: General Software Discussions
Topic: Python, improved splitMSODataFast, 70 times faster for 5Msamples
Replies: 3
Views: 7761

Re: Python, improved splitMSODataFast, 70 times faster for 5Msamples

Thank you Christian!

It is even more than 2 times faster!
splitMSO_np_unpackbits_version.PNG
by Anders_Eriksson
Wed Apr 15, 2020 12:49 pm
Forum: General Software Discussions
Topic: Streaming with Python
Replies: 7
Views: 13654

Re: Streaming with Python

Hi! I have a 3204D MSO scope. I have been experimenting with ps3000aStreamingExample.py and added digital trig on bit D5 negativ edge chA has a triangle waveform with 1Hz, +- 200mv pk-pk, blue signal chB is connect with a 10times probe to the same digital waveform that is connected to D5 (3.3V => ap...
by Anders_Eriksson
Tue Jan 14, 2020 1:58 pm
Forum: General Software Discussions
Topic: Python, improved splitMSODataFast, 70 times faster for 5Msamples
Replies: 3
Views: 7761

Re: Python, improved splitMSODataFast, 70 times faster for 5Msamples

Hi again, An even better version, from 177ms to 107ms def splitMSO_np_version_3(buffer): np_buffer = np.ctypeslib.as_array(buffer) d = lambda n: (np_buffer << (15-n)) >> 15 return [d(n) for n in range(8)] %timeit d0_d7 = splitMSO_np_version_3(bufferDPort0Raw) 107 ms ± 873 µs per loop (mean ± std. de...
by Anders_Eriksson
Tue Jan 14, 2020 11:51 am
Forum: General Software Discussions
Topic: Converting quadrature encoder signal
Replies: 1
Views: 3455

Re: Converting quadrature encoder signal

Hi again, Here is a small example! import numpy as np %matplotlib notebook import matplotlib.pyplot as plt chA = np.array([0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0]) chB = np.array([0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0]) def Encoder2pos(chA, chB): chA = (chA > 0.5) * 1 chB = (chB > 0.5) * 1 chA_plus_m...
by Anders_Eriksson
Tue Jan 14, 2020 10:26 am
Forum: General Software Discussions
Topic: Converting quadrature encoder signal
Replies: 1
Views: 3455

Converting quadrature encoder signal

Hello, I have asked for this encoding functionality in Picoscope6 and also searched on internet, but without any luck. So I want to share this. I am new to python, numpy and Jupyter notebook, but I am really impressed of how well it works! Below is the code, see also the attached 2 figures of an exa...
by Anders_Eriksson
Tue Jan 14, 2020 8:50 am
Forum: General Software Discussions
Topic: Python, improved splitMSODataFast, 70 times faster for 5Msamples
Replies: 3
Views: 7761

Python, improved splitMSODataFast, 70 times faster for 5Msamples

Hello, I have been using the "save to mat4 file" option in Picoscope6 together with Octave, but because of some bugs in the saved mat file, I have started to use python and Jupyter notebook, numpy is really fast! So converting from ctypes to numpy arrays improves speed, In my case with 5000000 (5Msa...
by Anders_Eriksson
Fri Jan 10, 2020 12:43 pm
Forum: General Software Discussions
Topic: [Python][PS3206D MSO] measurements with digital channels
Replies: 5
Views: 5893

Re: [Python][PS3206D MSO] measurements with digital channels

Hello again! After alot of copy and pasting from ps2000a.py to ps3000a.py and updating the lib by "python setup.py install" and comparing the VisualStudio c++ project examples, I found the problem! Perhaps you have had the same problem Marc? I called ps3000aSetTriggerChannelConditions, but with the ...
by Anders_Eriksson
Fri Jan 10, 2020 11:21 am
Forum: General Software Discussions
Topic: [Python][PS3206D MSO] measurements with digital channels
Replies: 5
Views: 5893

Re: [Python][PS3206D MSO] measurements with digital channels

Hi I am also trying to get a digital trig to work in the ps3000aBlockMSOExample I have copied and pasted the example code for the ps2000a example, but now I get --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ~\PythonTool\p...