Jump to content
  • 0

Using the spectrum analyzer on Raspberry Pi 4


Mona

Question

Hi, 

I'm using a custom python script to do spectrum analysis using Digilent Analog Discovery 2. I'm relying on the useful WF_SDK modules provided on the github repository here: https://github.com/Digilent/WaveForms-SDK-Getting-Started-PY/tree/master/WF_SDK . The module, tools, contains the spectrum analysis function. However, when the code reached this line (line 55 in the tools module):

dwf.FDwfSpectrumWindow(window_buffer, ctypes.c_int(buffer_length), window, ctypes.c_double(1), ctypes.c_double(0))

It resutls in 

Segmentation fault

I'm running the code on Raspberry Pi 4 model B (Raspbian GNU/Linux 11). Waveforms version is 3.19.5, and python version is 3.9.2. 

I would also like to note that I ran the exact same code on my PC windows 10 (3.19.5, and python version is 3.9.13) and it works just fine. Could this be a Debian compatibility issue? and what are the possible solutions? 

Thank you in advance,

Mona

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Mona

The last argument should be a pointer, byref(to a c_double) or None nullptr if you are not interested in this.

rgdWindow = (c_double*nSamples)()
vBeta = c_double(1.0) # used only for Kaiser window
vNEBW = c_double() # noise equivalent bandwidth
dwf.FDwfSpectrumWindow(byref(rgdWindow), c_int(nSamples), DwfWindowFlatTop, vBeta, byref(vNEBW))

or

dwf.FDwfSpectrumWindow(byref(rgdWindow), c_int(nSamples), DwfWindowFlatTop, vBeta, None)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...