| Electronics > Projects, Designs, and Technical Stuff |
| Low frequencies Vector Network Analyzer, arduino based. |
| << < (15/20) > >> |
| MasterT:
--- Quote from: radioactive on September 25, 2018, 11:01:39 pm --- I think the difference in results are because of floating point precision. Just to test that idea, I changed every float type in your test code to double and then implemented a test to run on a Cortex M7 MCU (results are the same on PC). I also added a test to compare the execution time of Goertzel vs your implementation of FFT. It executes about 3x faster with your current configuration of N=256. I didn't try to optimize the initGoertzel() function either, so might gain a little there too. // Even so, I guess that savings in time might not be worth messing with in your case. If the FFT is working great and there is no need to improve the timing, you have already validated the FFT. I don't see a need to change it. It gets the job done. --- End quote --- Right, floating point type is generating rounding noise. 1. The problem with a Goertzel (as any IIR) it demands 64-bits math, same time fft runs smooth and easy on 32-bits. SAM3X8E is 32-bits, w/o FPU, so difference in the time execution has to be verified on my DUE. Difference in 64-bits Goertzel vs 32-bits FFT. 2. Next, in the initial code you omitted windowing function, and this comparison 3x in timing is not correct, if fft-time / grt-time = 3, than (fft-time + windowing) / (grt-time + windowing) != 3. 3. Phase data I calculated out of Goertzel is not correct, error seems consistent 22.5 degree "off" - that may be corrected or not, anyway needs more testing to be verified in all circumstances. // All this hussle was started by people persistently pointing me that fft for single bin doesn't make any sense. |
| Bud:
This exersize in comparing sampling algorithm is pointless without a calibration procedure. You can fft until cows come home and get meaningless results because of the systematic errors not being removed. |
| ogden:
--- Quote from: MasterT on September 26, 2018, 01:32:45 pm ---All this hussle was started by people persistently pointing me that fft for single bin doesn't make any sense. --- End quote --- Hell, no! It was started by you suggesting that nobody but you knows The answer to the ultimate question of life, the universe and DSP: --- Quote from: MasterT on September 21, 2018, 02:51:10 pm ---Manny people don't understand the absolute supremacy of the FFT on any other method of data processing. The question of "why using FFT instead of DCT?" is the same as "why to sample data by ADC and than process in DSP core, if we can drive a couple of MUXes by quadrature shifted clock?" Because FFT provides processing gain, increasing SNR ratio by >30 dB(!). --- End quote --- --- Quote from: MasterT on September 21, 2018, 10:35:16 pm ---All this delusion about DFT /DCT /Wavelets arises from misunderstanding basic fact, that FFT is the most efficient, accurate and fastest algorithm. --- End quote --- --- Quote from: MasterT on September 21, 2018, 10:35:16 pm ---There are things that not everyone would ever understand, despite "correct" vocabulary they use. --- End quote --- |
| radioactive:
--- Quote from: MasterT on September 26, 2018, 01:32:45 pm ---2. Next, in the initial code you omitted windowing function, and this comparison 3x in timing is not correct, if ... All this hussle was started by people persistently pointing me that fft for single bin doesn't make any sense. --- End quote --- I didn't omit the windowing function, you did. --- Quote from: MasterT on September 25, 2018, 04:41:54 pm --- No windowing function is applied in this test, not to obscure the purpose of the testing. --- End quote --- I agree that 3x timing difference is not correct. This was just the timing difference for calling full-sweep with your SNR functions for grt vs fft 1000 times.. The Goertzel function would be thousands of times faster for your original specs: N=2048, single-bin. I think the real point of all this was showing that the FFT, DFT, Goertzel are all going to give you the same results for a single bin. In my opinion, the real take-away should be this: For optimal efficiency (sometimes this doesn't matter), 1) use FFT if you need results across the entire channel. 2) use a single-bin DFT if you need a single bin with complex input, 3) use Goertzel if you need a single bin with real input only. [edit] Btw, thank you for the FFT code. It is nice looking code. |
| MasterT:
--- Quote from: radioactive on September 26, 2018, 03:37:52 pm --- I didn't omit the windowing function, you did. --- End quote --- I'm referring to your first post, where you comparing fftw vs goertzel: https://www.eevblog.com/forum/projects/low-frequencies-vector-network-analyzer-arduino-based/msg1844921/#msg1844921 Why you didn't apply windowing, as you should? Than, would be a huge difference in the two charts, would not it? And you are ignoring the fact, that Goertzel is meaningless w/o 64-bits architecture. |
| Navigation |
| Message Index |
| Next page |
| Previous page |