Page 1 of 1

Max number of samples for a FFT in STEMlab 125-14

Posted: Thu Apr 18, 2024 10:56 am
by javiruni10
Hello, i am working on a project for performing a FFT on a STEMlab 125-14 (as can be seen from my various posts on the forum. Sorry for that!).

I am trying to perform an FFT with different input signals, ranging from 100 Hz to 10 KHz os the like. The thing is, working with the ADC sampling rate from the 125-14, which is 125 MHz, i would need to acquire 1,25MS for a single period of a 100 Hz input signal, and be able to perform the FFT.

Would that many samples be ok? Is there any suggested architecture to get that done?

Thanks in advance.

Re: Max number of samples for a FFT in STEMlab 125-14

Posted: Fri Apr 19, 2024 9:03 am
by juretrn
Hi,
are you sure you need to work at the full data rate when acquiring such a slow signal? You could try decimating the data at those rates and take the decimation into account when calculating the FFT.

There is no way you could store ~2MB inside of a Zynq 7010 or 7020. The only option would be to store the data into RAM using the AXI HP ports.

Re: Max number of samples for a FFT in STEMlab 125-14

Posted: Thu May 02, 2024 12:59 pm
by javiruni10
Thanks! that seems like the best idea. Best method for decimation? Could it be tunnable? Like, when working with a 100 Hz signal, acquire 1 of every 100 and when working when 1000 Hz, acquire 1 of every 100 and so on?

I would also love any insight into how to send a trigger (maybe from PS?) to start the data acquisition. Is that doable, maybe from python? I would like to send that trigger, acquire, and then save the data when t_last arrive.

Any implementation doing a similar thing would be very welcome.

Thanks in advance.

Re: Max number of samples for a FFT in STEMlab 125-14

Posted: Thu May 09, 2024 12:52 pm
by juretrn
The current oscilloscope project supports arbitrary decimation values. Those may be changed during normal operation, although I would not change it during a single acquisition.
The implemented decimation is either averaging or non-averaging (meaning just pick every N-th sample in the signal).
You can trigger the acquisition programmatically by setting the correct trigger source in our project.
(project name v0.94)

See

https://redpitaya.readthedocs.io/en/lat ... cilloscope

at offsets 0x4, 0x14 and 0x28.

Will you be creating an image from scratch or will you be modifying an existing one?

Re: Max number of samples for a FFT in STEMlab 125-14

Posted: Mon May 13, 2024 9:00 am
by javiruni10
I would like to create an application from scratch and from Vivado. Doing a FFT on the ADC samples.


Want to change m_axis_data_tvalid from PS, therefore acquiring just the specific number of samples i want and only when i am sure i got signals going on my channel (i would like to send a trigger from PS with a button on the web app or something like that).

Is there any example that can help me doing it?

Re: Max number of samples for a FFT in STEMlab 125-14

Posted: Fri May 17, 2024 9:00 am
by juretrn
You can check how to do an acquisition in
https://github.com/RedPitaya/RedPitaya- ... ya_scope.v

Lines 353-476 are a simple acquisition state machine that can change the acquisition length and save trigger pointers. The acquisition enable signal is "adc_dly_do".

Decimation is done at lines 154-339.

An example of a software trigger is at line 855 (adc_trig_sw) - a single pulse at register write and immediate reset of the signal to 0.

The acquired data is then saved into a BRAM.
You can then access said BRAM as any other register using M_AXI_GP0.