Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Spectrum Analyzer Research paper

Status
Not open for further replies.

Daljeet12

Member level 4
Member level 4
Joined
Jun 16, 2018
Messages
78
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
648
Hi
I found one research paper https://ijarcce.com/wp-content/uploads/2016/09/IJARCCE-7.pdf. I'm trying to understand it.

There are three tasks for the example.

1) Take ADC data
2) FFT processing
3) Display Real-Time Data

I am trying to understand how the deadline of each task is achieved in this type of project. When and How CPU time is allocated for each task.
 

There is no hard real time processing, just as the ADC finishes writing to a buffer it triggers the FFT algo using interrupts while resetting the ADC to the next bank. The FFT algorithm is light enough that no conflicts are caused.
 
There is no hard real time processing, just as the ADC finishes writing to a buffer it triggers the FFT algo using interrupts while resetting the ADC to the next bank. The FFT algorithm is light enough that no conflicts are caused.
I am trying to figure out the following points
  1. How much screen flicker is acceptable?
  2. How much delayed ADC data input is acceptable?
  3. How much delayed FFT processing is acceptable?
 

Hello!

How much screen flicker is acceptable?

This question is a bit strange. I guess we cannot set for you the specs of what you
want to build. The real questions is how exactly you define the flicker (as a measurable
value)? Is it the frame rate value from which you can observe only a smooth transition? (i.e.
the signal looks continuous in time)? Is it the ratio of frame display vs display update
times?

How much delayed ADC data input is acceptable?

Again, what do you want to measure? The papers talks about audio ADC, so this gives an
idea of the sampling frequency which should be more than 40k, and in order to have good
phase data, you need (maybe) 100 ksps. But beside this, the number of data samples you
are going to use will yield the definition of your signal. What definition do you need?

How much delayed FFT processing is acceptable?

This question is not clear. I will suppose you are talking about the delay induced by
your FFT. How much delay is acceptable between sample and display.
But again, it depends on what you want to do. If you want to have an idea of what's
going on and just have a display of the FFT, I would say the processing time is not
crucial. Any processor, even a low end one, will compute your FFT within, say, 50ms
assuming the sample set is reasonable. You will not notice any delay.

But this also depends on your LCD. How much time is required to write one screen,
does it have a double buffer, etc, etc...

Dora
 
Screen frame rate which creates the impression of smooth motion is usually 24 f per second. Example, motion pictures shown in theatres.

Youtube videos are default 30 fps. At pixel height 720 or 1080, many offer higher quality 48 or 60 fps.
To see various parameters during play, right-click in the frame and select 'Stats for nerds.' These provide clues to the video data rate, your internet speed, dropped frames indicating how well your system keeps pace, etc.

Computer screens 60 fps. Options may offer 75 fps, etc.
 
Hello!
This question is a bit strange. I guess we cannot set for you the specs of what you
want to build.

Dora

I am trying to understand how CPU time is utilize in spectrum analyzer because all the tasks are real time tasks and need to be completed within the time limit.

Taking hypothetical specification.

1) Sample needs to be taken every 20us. If it takes more than 20us. we will lose sample.

2) FFT takes 20 ms to process a 1024-word array. If it takes more than 20ms. we will lose data.

3) Display needs to updates every 15ms. If it takes longer than 15 ms, display performance will suffer.

how to allocate CPU time for each task
 

The only "hard" real time requirement is equidistant sampling of ADC data. It will be usually controlled by a hardware timer and DMA data transfer, this way it's completely independent of other tasks.

FFT and display update can run as fast as possible. A LCD display continuous to display the last loaded data, there's no need to refresh it periodically. Update of spectrogram display faster than a few Hz isn't human readable. At best you can combine a peak level line with slow decay and a faster instantaneous level line. A higher update rate than 10 or 15 Hz is still not useful.
 
Hello!

OK, 20µs sampling means 50 kHz. If you make 1024 sample calculation, you will do
(roughly) 50 buffers per second, and you will indeed have 20 ms to process every
buffer, but you will have no time to do anything else.

BUT, there are 2 things to think about:
- Updating the screen at more than 25 Hz will not serve any purpose because your
eye will think it's smooth enough, except if you do something else (detection?)
with your FFTs. If it's purely spectrum display, then you don't _have_ to calculate
everything.
- If you don't display all the data, then you don't have to calculate all the FFTs,
and therefore you don't have to sample all the data.

Therefore, you can do like this:

- Kick the ADC DMA @ 50 kHz to get your first sample set (should take about 20 ms)

Then the following process should repeat:
On DMA interrupt
- Kick next ADC DMA (takes no time)
- Calculate FFT 20ms
// At this point, the next ADC buffer is available, you will have to process
// it after display and you will therefore have a 15 ms sampling blank.
- Display 15ms

This should keep running at 1 / (20+15) = about 30 fps.

Now if you want no blank at all, then your FFT + display have to be shorter than
your ADC period.

Therefore you have to choose your processor wisely.
- 50 kHz sampling is not a big deal, many small processors can do that.
- 1024 FFT at 20ms is certainly possible but you have to make experiments.
- 15ms for display, it's hardware-dependent, but there are 2 things, you have
to build the data and then send it.

As for sending: Suppose you define a 256 x 256 pixel window that you want to fill with
a 16 bit color depth by a SPI connection at 10 MHz:

Number of bytes to be sent: 256 x 256 x 2 (w * h * 2) = 131072 bytes = 1 MBit.
If you send them at 10 MHz without any space, sending data to the display will
also take 100 ms. It can also be done by DMA, but anyway DMA will not make it
run faster than 10 updates per second.

Dora
 
Assuming that I set a timer interrupt of 20µs for sampling. Interrupt service take 2µs processor time. Will FFT processing happen after every 2µs ? Will there be any effect on FFT processing due to 2µs service time.
 

Hi,

if the interrupt takes 2us every 20us then this means 10% of processing power.
Leaving 90% of processing power for the FFT.

Klaus
 
Hi,

Since there is only 90% of processing power ... the calculation takes about 10% more time.
But for sure the result is the same.

Klaus
 
Hi,

Since there is only 90% of processing power ... the calculation takes about 10% more time.
But for sure the result is the same.

Klaus

How is the real time FFT spectrum displayed on the display. There is a total of 1024 samples, then the result of all these samples shown on the screen together, or the result is shown one by one.
 

Assuming that I set a timer interrupt of 20µs for sampling. Interrupt service take 2µs processor time. Will FFT processing happen after every 2µs ? Will there be any effect on FFT processing due to 2µs service time.
Using a timer assumes that you don't have either an ADC that can be set up to run continuously at the desired sampling rate and/or that you don't have DMA available. If you have ether (and preferably both) then the hardware can do all of the fast work and all you have to do is the FFT (I assume you mean DFT!) and the display update.
If you select an MCU with dual cores then that will help as well. There are examples with devices such as the Raspberry Pico (https://www.hackster.io/AlexWulff/adc-sampling-and-fft-on-raspberry-pi-pico-f883dd was the first I found on a Google search) that might give you some ideas as well.
Susan
 

Hi,
How is the real time FFT spectrum displayed on the display.
I rather expect you to give us this information, than ask for it.
How can we know?

An FFT with 1024 samples as input gives 512 frequency results.
Prior to the FFT you usually need a windowing function.
And after the FFT you maybe need to scale the linear amplitudes into logarithmic (dB) amplitudes.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top