Basic of Real-Time Spectrum Analyzer

Thread Starter

Kittu20

Joined Oct 12, 2022
474
Here is what you can do with a capable 32-bit chip with DMA.

LCD driver update time.

That update takes 2.33 ms using 15MHz SPI in background.
I am sure you must have done timing calculation while doing your design. Can you explain the math ( Timing) of the your application.

Task time
1) At what time interval should ADC sampling be done

2) At what time interval should FFT data processing be done

3) At what time interval should LCD update be done.

CPU time

1) How much CPU time does your processor take for ADC sampling?

2) How much CPU time does your processor take for FFT processing?

3) How much CPU time does your processor take for LCD update?

Edit : If you can give rough calculation also then that is also acceptable.
 
Last edited:

BobTPH

Joined Jun 5, 2013
9,001
You proposed the problem, it is up to you to specify the requirements! Why are you asking us?

Your original post said audio frequencies. What does that tell you about how often samples must be taken?

The update time for the display is entirely up to you. How often you want the display updated? it could be as fast as possible, every second, every minute. It depends on what you are trying to do.

@MrChips proposed specifications were intended to show a real-time requirement that could not be met by tasks in an RTOS, and therefore had to be done with direct usage of hardware capabilities. It has nothing to do with your audio analyzer example.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
474
You proposed the problem, it is up to you to specify the requirements! Why are you asking us?
When did I say I'm going to use RTOS for the audio frequency analyzer. I was trying to understand the basics of spectrum analyzer. it has nothing to do with RTOS

Yes i am studying RTOS fundamentals. But I will not discuss it in this thread, there will be a different thread for that.
 
Last edited:

BobTPH

Joined Jun 5, 2013
9,001
I didn’t say you did, MrChips mentioned RTOS. He was not proposing a sample rate for an audio analyzer.

How about addressing the rest of my post now.

What do you think the sampling rate must be for an audio analyzer?
 

nsaspook

Joined Aug 27, 2009
13,312
I am sure you must have done timing calculation while doing your design. Can you explain the math ( Timing) of the your application.

Task time
1) At what time interval should ADC sampling be done

2) At what time interval should FFT data processing be done

3) At what time interval should LCD update be done.

CPU time

1) How much CPU time does your processor take for ADC sampling?

2) How much CPU time does your processor take for FFT processing?

3) How much CPU time does your processor take for LCD update?

Edit : If you can give rough calculation also then that is also acceptable.
No, I'm not going to do rough calculations for you, that's asking too much and you need to learn instead of just being told.

All of these tasks should be designed to be independent (by using asynchronous hardware to reduce the required CPU requirements for each task) and to overlap with processing triggers for the needed processor time.

Some RPi external ADC timing. 20000 byte SPI transfer @ 64MHz
https://forum.allaboutcircuits.com/threads/fifo-logic-block-meta-stability.136284/post-1143365

Some LCD timing.
https://forum.allaboutcircuits.com/threads/pic32mk-mc-qei-example.150351/post-1617150

FFT timing.
https://forum.allaboutcircuits.com/...nd-sensor-node-for-canbus.189388/post-1776355

2.5ms total for FFT compute (256 double elements to a 8-bit spectrum buffer) and graphics memory update (250us of that 2.5ms).
 
Last edited:
Top