Electronics > Projects, Designs, and Technical Stuff
Low frequencies Vector Network Analyzer, arduino based.
<< < (11/20) > >>
Kleinstein:
It dependents on the way the sin / cos values are calculated. With an efficient method (e.g. table or cordic like (Görtzel algorithm or similar)) the DFT for 2 bins is usually more computational efficient than the full FFT and ignoring most of the data. The result is essentially the same, except for possible rounding errors, that should not be significant for 12 Bit raw data.  It is just a different way of calculation. So the effective BW is exactly the same.

The expected advantage in computation time is about about a factor of 10  (details depend on the µC). The DFT code can definitely do real time operation, that is doing the calculation as fast as the data come in at 1 MSPS. Depending on the µC and compiler used one might get something like 8-30 µC cycles per ADC sample.  There is a slight chance the FFT code could also operate real time with 1 MSPS data, though it would be hard and need a faster µC.

The memory use is much lower for the DFT - something like 2 or 4  numbers of about 32 Bit, maybe even 16 bit. For the same window length the result is essentially the same, so no difference in SNR ratio. The DFT solution is flexible to allow longer windows if needed, as there is essentially no memory limitation. In this case a slightly better SNR would be possible. However even with FFT data there is also a chance to use coherent averaging over longer time and thus the same SNR.
MasterT:

--- Quote from: Kleinstein on September 23, 2018, 08:08:49 pm --- With an efficient method (e.g. table or cordic like (Görtzel algorithm or similar)) the DFT for 2 bins is usually more computational efficient than the full FFT and ignoring most of the data. The result is essentially the same, except for possible rounding errors, that should not be significant for 12 Bit raw data.  It is just a different way of calculation. So the effective BW is exactly the same.
..///.

The memory use is much lower for the DFT - something like 2 or 4  numbers of about 32 Bit, maybe even 16 bit. For the same window length the result is essentially the same, so no difference in SNR ratio. The DFT solution is flexible to allow longer windows if needed, as there is essentially no memory limitation. In this case a slightly better SNR would be possible. However even with FFT data there is also a chance to use coherent averaging over longer time and thus the same SNR.

--- End quote ---

This is where you do a big mistake. BW is Not the same. SNR is not the same. Stop fooling yourself, there is no free cheese in the mouse trap.
 Reducing fft code down,  in any manner, gaining in memory or clock cycles is become NON relevant, since you are getting the product with lower quality. Lower freq. resolution per bin , lower SNR, missing imaginary part (DCT) etc.
It's same as small print on your insurance policy, bunch of crooks advertise you different variety of the fft, but any variation is
a crap, if you look more carefully into the output.
 Getting back  to the numbers, Görtzel algorithm is unable to select channel 244 Hz wide at 249 756 Hz. Never ever.
Kleinstein:
The DFT result is the same (except minor rounding differences) as FFT. One needs the second bin to get the imaginary part. So using the 2 bins DFT instead of the FFT is just a different computational method, but essentially the same result.

The FFT algorithm is the most efficient known way if all bins are needed. However it is not the most efficient way anymore if one only needs 2 bins. :horse: 

The exact speed does not matter - the question is only if the FFT code could be fast enough to do the calculations in real time, I have some doubt it can with the STM32F3... Even if fast enough, there is the limitation with memory usage.

The possible frequency resolution with the Görtzel Algorithm only depends on the time used and the numerical accuracy. So with enough resolution (e.g. 32 Bit data) the resolution can be way better than 1 Hz in 1 MHz if needed. It just needs time (e.g. a few seconds).
ogden:

--- Quote from: Kleinstein on September 23, 2018, 09:00:53 pm ---The DFT result is the same (except minor rounding differences) as FFT.

--- End quote ---

This sentence is said like five times here in this thread? Your patience is unreal :popcorn:


--- Quote from: MasterT on September 23, 2018, 08:34:00 pm ---This is where you do a big mistake. BW is Not the same. SNR is not the same. Stop fooling yourself, there is no free cheese in the mouse trap.

--- End quote ---

Right. BW of FFT and DFT. If such actually exists  :-DD
MasterT:

--- Quote from: Kleinstein on September 23, 2018, 09:00:53 pm ---The possible frequency resolution with the Görtzel Algorithm only depends on the time used and the numerical accuracy. So with enough resolution (e.g. 32 Bit data) the resolution can be way better than 1 Hz in 1 MHz if needed. It just needs time (e.g. a few seconds).

--- End quote ---

 Time frame is already defined, I have 2048 samples accumulated in data pull, please give me a favor - run Goertzel and see what frequency resolution you would get. 

If you are saying, that 1 000 000 samples has to be processed, to get EQUAL to fft-2048 frequency resolution (244 Hz) , than  calculate clock cycles you spend and compare to fft-2048 , I'm sure that would surprise you. Goertzel gonna to loose quite a lot to get same numbers.

Ratio :  " BW / Clock_Cycles", if you are pulling one (BW) or another "Clock_Cycles" out of equation,  you are trying to cheat.  It's not a  poker.
Both parameters has to be evaluated in the same time frame, numbers of samples, same test condition.  Otherwise you are manipulating data.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod