| Electronics > Projects, Designs, and Technical Stuff |
| Low frequencies Vector Network Analyzer, arduino based. |
| << < (12/20) > >> |
| radioactive:
This might help with evaluating. I started with a C implementation of the Goertzel algorithm from here: https://www.embedded.com/design/configurable-systems/4024443/The-Goertzel-Algorithm I hacked it up to add the FFT to compare against. It depends on libfftw http://www.fftw.org/ compile it gcc goertzel_test.c -o goertzel_test -lm -lc -lfftw3 The magnitudes are almost identical over a narrow sweep around the "frequency bin of interest" just to make it visually interesting. This is a very good reference from Richard Lyons book https://www.embedded.com/design/real-world-applications/4401754/Single-tone-detection-with-the-Goertzel-algorithm |
| Dave:
--- Quote from: MasterT on September 23, 2018, 03:32:18 pm ---Nothing of the kind. Is it engineering forum? I don't like to be involved in any philosophical / political / or abstract mathematics debates. And I 'm not worry if there is a life on a Venus. The point is, engineers should talk in different terms, leaving abstract "better", "less memory" " faster". Tell me in dB, uVolts, microseconds, or in this particular case, tell me the Bandwidth in Hz for single bin DFT. --- End quote --- Sure, let's pretend that "better", "less memory" and "faster" are open to any kind of interpretation. :palm: Attached to this message is a MATLAB script that I've written to compare DFT and FFT. Save the file and change the file extension to .m (the forum does not allow .m files). Run it and carefully read through the code. |
| MasterT:
--- Quote from: Dave on September 23, 2018, 10:18:43 pm ---Attached to this message is a MATLAB script that I've written to compare DFT and FFT. Save the file and change the file extension to .m (the forum does not allow .m files). Run it and carefully read through the code. --- End quote --- I'm "self-educated" in C and Java, have EE degree from Russia. But we didn't study matlab in 90-s, sorry for disappointing, no I'm not a digital robot. --- Quote from: radioactive on September 23, 2018, 10:15:45 pm ---This might help with evaluating. I started with a C implementation of the Goertzel algorithm from here:/// --- End quote --- Thanks for sharing, I will test your code in Qt, though I already know the answer. |
| Dave:
This is the output of my script. Top graph is magnitude, bottom is phase. Red line with points is DFT, green dashed line is FFT. |
| radioactive:
--- Quote from: radioactive on September 23, 2018, 10:15:45 pm ---This might help with evaluating. I started with a C implementation of the Goertzel algorithm from here:/// --- End quote --- --- Quote ---Thanks for sharing, I will test your code in Qt, though I already know the answer. --- End quote --- Don't bother. I just realized you need the complex input/output for your application. Goertzel algorithm will work almost exactly as FFT/DFT for calculating magnitude from real data, but you need complex input/output for your application. I will add that I do agree with the others here suggesting that a single-bin DFT would be more optimal for N=2048 and completely identical in output compared to FFT (including your bandwidth concerns). They are the same thing. Others have already said it, but FFT is better only if you need to calculate *all* of the bins. Sorry for not taking a look at your project video before my earlier posts. It looks really great! |
| Navigation |
| Message Index |
| Next page |
| Previous page |