cancel
Showing results for 
Search instead for 
Did you mean: 

Rendering frequency spectrum

Petr3
Associate III

Hello,

i want to render frequency spectrum FFT in the small area of screen and handle touch in this area. This should be done by some custom widget/container. Can you help me how to do it?

 

Best Regards,

Petr

7 REPLIES 7
GaetanGodart
ST Employee

Hello @Petr3 ,

 

It seems that the graph widget would be enough to display fast Fourier transform.

The dynamic graph have more methods available. You can for instance click on an area of the screen to get the data there.

Do you have something specific that you want to do that a graph widget wouldn't be able to do?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hello GaetanGodart,

yes, i trying to show RF signal periodically recieved from FPGA. So STM should recieve data, compute FFT and show each sample set in the display area. Additionaly touch and slide in this area should call some functions for show some menu, move frequency spectrum left/right etc. Basically touch and slide in the area should be handled.

 

Best Regards,

Petr

Sure!

 

I don't know how to help you on getting the data and computing the FFT.

 

However, I can help you on displaying the result of the FFT.
It seems you want to be able to zoom in and out and to move inside the graph when zoomed in.

To zoom, you can add a couple buttons (one to zoom in and one to zoom out).
You can look at the Dynamic Graph Example and at the methods getScale and setInterval.

To slide, you can fetch a drag movement directly on the widget natively.
You can look at the method setXAxisOffset.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi,

 

I have computed FFT in the STM from FPGA data. I can create spectrum graph for data and store it into SRAM or SDRAM}lets say 480x200@16bpp]. And now i need to show it on the screen via some widget/container in the TouchGFX. Additionally i would like to use fonts in the graph from the TouchGFX for describing/putting numbers on X and Y axis. I think this should be done by creating custom container right?

Slide on the left/right in this area should tell to STM to compute FFT from lower/higher frequency band and create new graph to display on TFT. Basically i need to recognize slide in this area and ideally get speed and length of slide. The touch anywhere in this graph area should popup some submenu or move cursor in the graph.

 

Best Regards,

Petr

I don't really know what you mean by "describing/putting numbers on X and Y axis".
But you can add labels on the dynamic graph directly.

Directly in the widget dynamic graph, you can get triggers when the user click the graph or drags the graph (dynamic-graph#triggers) , from there you can call a function to do whatever you want such as redrawing the graph with new values.

Regarding the redrawing, maybe the best thing for you would not be to create a new graph but simply to change de data points, that would be faster and simpler.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi,

i would like generate my own graph in my firmware, store it in external SDRAM and put it as image on display. I would like to use TouchGFX fonts for X/Y labels, is it possible?

In the other words, i would like create something like this:

droppedImage_1.jpg

 with interactions via touchscreen.

So i dont want to use widget dynamic graph. I want to show some pixels stored outside TFT screen buffer. I have 4 banks external SDRAM 4x2MB and im using 16bpp single buffer and single layer. For 800x480@16bpp TFT i need 750kB screen buffer located in bank 0. The periodically computed graph, lets say 400x200@16bbp image will be stored in bank 1 and i want to say to TouchGFX pick this data and copy it into screen buffer in bank 0.

Hey @Petr3 ,

 

If you just want to show text, you can use the TextArea widget .

I still think your design is feasible with a dynamic graph but you can definitely create it yourself, store it in SDRAM and display it in TouchGFX.
I think that the best approach would be to use a dynamic bitmap that will take as input the image you created at runtime.
Have a look at loading-images-at-runtime .

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)