Command-line using generate & spectrum

Tell us how your experiment is running with Red Pitaya
Post Reply
lafatpav
Posts: 1
Joined: Fri Mar 08, 2024 12:55 am

Command-line using generate & spectrum

Post by lafatpav » Fri Mar 08, 2024 1:11 am

Hello,
I use RP in simple command-line (bash) mode. My goal is to measure frequency response of a system at specific frequencies. My tought was to generate simple sine at specific frequency from OUT1 connected to the input of the tested system and using spectrum analyzer at IN1 connected to output of the system to save the spectrum response of a system.
But when I use a bash script like:

Code: Select all

generate 1 1 1000 sine
LD_LIBRARY_PATH=/opt/redpitaya/bin/spectrum -m 0 -M 10000 -C > output_file
generate 1 0 1000 sine
The problem is that after the generator is turned on, when calling the spectrum analyzer, the generator goes off, therefore I cannot measure the response.
What I need is to simultanously run the generator during spectrum acquisition and to turn off the generator after I obtain the required spectrum (las command line). In web application of a spectrum analyzer, this can be simply done (by clicking OUT1 generator on), but I need to perform this using command line (I need to repeatedly measure this in a for cycle).
Thank you for any help.

Pavel

User avatar
redpitaya
Site Admin
Posts: 977
Joined: Wed Mar 26, 2014 7:04 pm

Re: Command-line using generate & spectrum

Post by redpitaya » Fri Mar 15, 2024 3:12 pm

Hello Pavel,

Thank you for writing on the forum.

There are two possible solutions to this, depending on your needs:
- Try using the Bode Analyzer application (it does exactly what you want over the whole frequency range of Red Pitaya)
- Use SCPI commands in MATLAB or Python to send a frequency pulse and capture the data from the device, then change the acquired data from time to frequency space using functions. Here are some examples: https://redpitaya.readthedocs.io/en/lat ... l#examples
Alternatively, you can use the Python API commands on the board itself to do the recalculations.

It seems way simpler this way unless you have another application in mind.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 1 guest