PS4262 Cannot enable BW Limit from Python

Post any questions you may have about our current range of oscilloscopes
Post Reply
jkuhn
Newbie
Posts: 0
Joined: Thu Sep 20, 2018 6:05 pm

PS4262 Cannot enable BW Limit from Python

Post by jkuhn » Mon Nov 26, 2018 6:31 pm

Hi,

I have a 4262. My python test code is shown below. Setting BWLimited to True or False or 1/0 makes no difference to the capture. The capture has no BW limiting. If I use the Picoscope 6 software BW Limit makes the expected difference in rolling off the spectrum above 200Khz.

I'm have anaconda2 install and py version is 2.7.14. I don't see any version strings in the pico code but it was installed about 6 months ago.

Thanks,

Jay



import matplotlib.pyplot as plt
plt.switch_backend('Qt5Agg')
import matplotlib as mpl
mpl.rcParams['agg.path.chunksize']=500

import numpy as np
import pandas as pd
import time

import picoscope.ps4000 as ps
from matplotlib.pyplot import *
import yk_analog.python.utils.utils as ut

print("Hello")

ps = ps.PS4000()
coupling='AC'
VRange = 0.0025
BWLimited=1
returnedRange = ps.setChannel(channel="A", coupling=coupling, VRange=VRange, probeAttenuation=1,BWLimited=BWLimited)
n_captures = 1

print 'Returned Range = ', returnedRange
#ps.setResolution('14')
Ns = int(5e6)
Fs = 10e6
[actualSampleFreq, maxSamples]=ps.setSamplingFrequency(Fs,int(Ns))
ps.setSimpleTrigger("A", threshold_V=0, direction="Rising", timeout_ms=10000, enabled=False)
ps.setNoOfCaptures(1)


ps.runBlock()
ps.waitReady()
A = ps.getDataV("A")
B = ps.getDataV("B")
sampAcutal = np.size(A)
Ts = 1.0/ actualSampleFreq
xAxis = Ts * np.array(range(sampAcutal))

#Vmeas = A - B
Vmeas = A/1.0

Adc = np.average(A)
Bdc = np.average(B)
Vdiff_dc = np.average(Vmeas)
Vrms = np.std(Vmeas)

ut.dispFFT(Vmeas, Ts,cmplx = False, dBmHz = True, wind=False, smooth=100, figX=1500, figY=10, ylim=[-170, -132],linewidth=0.5)
plt.draw()
plt.show(block=False)
plt.pause(0.001)

Hitesh
PICO STAFF
PICO STAFF
Posts: 2854
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS4262 Cannot enable BW Limit from Python

Post by Hitesh » Thu Nov 29, 2018 5:05 pm

Hi jkuhn,

I would recommend using the bindings from the picosdk-python-wrappers repository on GitHub.

You should be able to call the ps4000SetBwFilter() function in order to set the filter using the definitions from the ps4000.py binding that it is in there.

Hope this helps,
Hitesh

Software Dev. Engineer

Post Reply