Posted Thu, 29 Feb 2024 22:52:22 GMT by Jim, Big
Hello,

Looking to get live fourier transform data for use in controlling other components in Python based on this data. 

I'm wondering if there's a live acquisition mode instead of quickly sending commands to get data. I'm also wondering if there's any code examples to get continuous data instead of having to run a loop with similar code:

scope.write("*CLS")
scope.write('header 0')
scope.write('WFMO:ENC BIN')
scope.write("*ESR?")
print(scope.query("EVM?"))
scope.write('SELect:FFT ON')
print(scope.query("FFT?"))
scope.write('ACQuire:MODe SAMple')
scope.write('DATA:WIDTH 1')
scope.write('ACQuire:STATE RUN')
print(scope.query('ACQuire:STOPA?'))
print(scope.query('ACQuire:STATE?'))
scope.write('DATA:SOURCE FFT')
scope.write('DATA:START 1')
scope.write('DATA:STOP 2000')
print(scope.query('WFMO:BYT_N?;NR_P?;YOF?;YMU?;YZE?;XIN?;XZE?'))
values = np.array(scope.query_binary_values('CURV?', datatype='b'))

I would really appreciate the help from anyone familiar with these sorts of applications. Thank you greatly
Posted Thu, 29 Feb 2024 23:39:53 GMT by Teles, Afonso
Hi Big Jim,

The TBS1kC does not have the ability to stream waveform data (some of our other scopes do have this capability with the curvestream command).
You'll have to poll repeated curve queries to get the data that you want.

Here's a few recommendations:

1) Disable the FFT on the scope and do it on the PC instead (make sure to apply a window function if needed), this will likely speed up the process a lot as processing FFT's on the scope is relatively slow compared to a modern PC, especially if you run the scope communication and data processing on different threads.

2) Set the encoding to binary and data width to 1 ( I see you're already doing this).

3) Set the sample rate to the lowest that you can get away with.
Posted Fri, 01 Mar 2024 14:32:57 GMT by Jim, Big
Afonso,

You are great. Thank you for the help & support. I will take the raw data and FFT it myself. I was planning on running the scope and FFT on different threads when I started this project but thought the FFT on the scope would be faster - thanks for the correction. 

Investigating the sample rate now. 

I'll update you here later today. Let me do some work and see what I can come up with.

Thanks greatly,
"Big" Jim
Posted Mon, 11 Mar 2024 22:58:37 GMT by Jim, Big
Hi Afonso, 

I'm now using a DPO 7354 oscilloscope with the curvestream function as opposed to the 1000 series. Thus, I'm inquiring if the FFT() function on the DPO7354 is still slower than a python script would be. I ask this because we are building calibration functionality where the max() of the FFT is taken to determine where the best signal is along shifting frequencies and a moving mirror if that makes sense. Thus, timing and speed are important.

If the 7000 series can handle this fast enough, I have posted my current code in another thread as a response to your other answer to my previous question.

Thanks,
"Big" Jim
Posted Tue, 12 Mar 2024 16:23:50 GMT by Teles, Afonso

Hi "Big" Jim,

That's a very complex question to answer as you're essentially comparing the speed of running FFT + the max measurement on the scope + transferring the result of that measurement to your PC versus the speed of transferring the waveform to the PC and doing the FFT + measurement there.

My guess is that running the FFT and max measurement on the scope and then transferring just the result of max would be significantly faster than the other option, but I don't know the speed of your connection or computer.

If you have the time to test both, that would be ideal.

Posted Tue, 12 Mar 2024 19:09:05 GMT by Jim, Big
Hi Afonso, 
 
I am having connectivity issues as detailed below. I have posted more details in the other thread. 

Thanks,
"Big" Jim
Posted Tue, 12 Mar 2024 22:23:06 GMT by Jim, Big
"Big" Jim back with an update.

I found I needed "SELECT:MATH<x> 1" to turn the MATH to ON state. It's a shame these things aren't more clear in the manual, it takes some time to find + troubleshoot.

Now I can play with the float point settings and see if I can get everything to line up in a plot. 

Thanks,
"Big" Jim

You must be signed in to post in this forum.