acquirefft command-line utility

Applications, development tools, FPGA, C, WEB
Post Reply
edgo
Posts: 34
Joined: Wed Jun 25, 2014 11:38 pm

acquirefft command-line utility

Post by edgo » Tue May 05, 2015 11:44 pm

More fun,

acquirefft is command-line utility for frequency domain analysis, here in the /Test/ directory:

https://github.com/edgo914/RedPitaya

This utility is a curious merge of acquire and the guts of the Spectrum Analyzer application's FFT routines :-)

The output is sent to stdout as a single column of dBm values.

You may set the Channel, Decimation, and Binning values like so:

redpitaya> ./acquirefft
Usage: ./acquirefft CH DEC BIN

CH Channel [1,2]
DEC Decimation [1,8,64,1024,8192,65536]
BIN Binning [1,2,4,8,16,32,64,128,256]

Number of frequency domain values returned is 8192 / Binning

The Spectrum Analyzer app essentially has hard-coded binning value of 4, so it always returns 2048 values, good for a web display. acquirefft has more binning flexibility, for your entertainment.

I did not remove the waterfall code, it is there but commented out in various places. An industrious individual in need of this functionality might figure out how to use it.

To build:
$ make CROSS_COMPILE=arm-linux-gnueabi- clean all

cheers,

edgo

edgo
Posts: 34
Joined: Wed Jun 25, 2014 11:38 pm

Re: acquirefft command-line utility

Post by edgo » Mon Jul 13, 2015 7:10 pm

I have just updated acquirefft to not use the default Equalization Filter Coefficients. This was causing a slight voltage offset to be reported incorrectly. Thanks to Nils for helping me dig this one out.

https://github.com/edgo914/RedPitaya/tr ... acquirefft

greggdaug
Posts: 26
Joined: Wed Jun 10, 2015 1:40 pm
Location: United States

Re: acquirefft command-line utility

Post by greggdaug » Sat Aug 22, 2015 9:55 am

Can this be modified to write out the raw complex values?

Thanks,

-Gregg

edgo
Posts: 34
Joined: Wed Jun 25, 2014 11:38 pm

Re: acquirefft command-line utility

Post by edgo » Tue Aug 25, 2015 12:44 am

Take a look in worker.c at rp_spectr_worker_thread()

In the call to rp_spectr_fft() [found in dsp.c] the real/imag values are available

The calls after that to rp_spectr_decimate() and rp_spectr_cnv_to_dBm() you might NOT wish to call if you want complex vals

And finally, rp_spectr_set_signals() would need to know that you are interested in the complex vals only, and any code above this that would normally report the dBm values

cadrev
Posts: 7
Joined: Mon Jan 18, 2016 10:37 am

Re: acquirefft command-line utility

Post by cadrev » Sun Feb 07, 2016 8:59 am

edgo wrote:More fun,

acquirefft is command-line utility for frequency domain analysis, here in the /Test/ directory:

https://github.com/edgo914/RedPitaya

This utility is a curious merge of acquire and the guts of the Spectrum Analyzer application's FFT routines :-)

The output is sent to stdout as a single column of dBm values.

You may set the Channel, Decimation, and Binning values like so:

redpitaya> ./acquirefft
Usage: ./acquirefft CH DEC BIN

CH Channel [1,2]
DEC Decimation [1,8,64,1024,8192,65536]
BIN Binning [1,2,4,8,16,32,64,128,256]

Number of frequency domain values returned is 8192 / Binning

The Spectrum Analyzer app essentially has hard-coded binning value of 4, so it always returns 2048 values, good for a web display. acquirefft has more binning flexibility, for your entertainment.

I did not remove the waterfall code, it is there but commented out in various places. An industrious individual in need of this functionality might figure out how to use it.

To build:
$ make CROSS_COMPILE=arm-linux-gnueabi- clean all

cheers,

edgo
How do I install this on the Red Pitaya? Everytime I start make, acquirefft is gone from the folder and I cant use the utility.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: acquirefft command-line utility

Post by Nils Roos » Mon Feb 08, 2016 2:34 am

First off, the build instructions are for the old ecosystem, the major difference being the soft-float vs hard-float architecture. Binaries for the old (<= v0.93) ecosystem will not run on the new (v0.94) one and vice-versa.

To analyze build problems, it is usually helpful to know a bit about the environment you are building in - did you follow the setup described in the github README, or from the wiki, or something else ? What OS is your host running ? etc.

cadrev
Posts: 7
Joined: Mon Jan 18, 2016 10:37 am

Re: acquirefft command-line utility

Post by cadrev » Mon Feb 08, 2016 1:16 pm

Nils Roos wrote:First off, the build instructions are for the old ecosystem, the major difference being the soft-float vs hard-float architecture. Binaries for the old (<= v0.93) ecosystem will not run on the new (v0.94) one and vice-versa.

To analyze build problems, it is usually helpful to know a bit about the environment you are building in - did you follow the setup described in the github README, or from the wiki, or something else ? What OS is your host running ? etc.
Sorry for the trouble, I solved the problem by doing another "make" after perform the cross compile. I overlooked this due to my inexperience on Linux. :oops:
I would like to further ask the ff: How is the frequency range computed/known whenever I use the acquirefft?


cadrev
Posts: 7
Joined: Mon Jan 18, 2016 10:37 am

Re: acquirefft command-line utility

Post by cadrev » Tue Feb 09, 2016 8:17 am

Thank you, I was able to solve my problems because of this. Nils Roos and you have been very helpful! Your help was much appreciated! :D

Program
Posts: 27
Joined: Thu Apr 14, 2016 3:14 pm

Re: acquirefft command-line utility

Post by Program » Fri Apr 15, 2016 1:43 pm

If I understand this correctly, sampling at a frequency of 125 MHz (decimation 1) and using a binning setting of 1 would give me a resolution of 125*10^6 / 8192=15,258 Hz, so roughly 15kHz. With decimation set to 8192, I'd have a resolution of 125*10^6 / (8192*8192) = 1.86 Hz (although I could only faithfully measure frequencies up to 7.5 kHz), right? Is it possible to increase the resolution for a given decimation by increasing the FFT length or is this prevented by memory size?

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 98 guests