Author Topic: Low frequencies Vector Network Analyzer, arduino based.  (Read 15553 times)

0 Members and 1 Guest are viewing this topic.

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #25 on: September 21, 2018, 10:05:14 pm »
I'm not sure what you mean by "cross-referencing" between bins. Isn't FFT effectively just a bank of narrow bandpass filters?

Try to generate 125kHz digital reference signal (sine) of the same length as your FFT, and use the same windowing. Correlate that with your wideband signal. You will get one number. If I am not completely wrong, that is the same number as your FFT gives for that bin.
Effectively yes, it's bank of BPF's. Internally fft engine does cross-correlation  against sine  & cosine And against each others components, there is summ-diff embedded. Exactly this sum-diff feature makes it's so efficient, compare to bank of FIR filters. Running 1024 FIR's (with 1024 kernel length) in parallel  would not be possible on any CPU I know.

Sure you can do cross-correlation with single 125k sine wave, that is another way to get delay or phase shift info. They do same things in all audio and video codec for compression of data, but using optimised version. Simple point-to-point cross-correlation is the highly unefficient operation
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #26 on: September 21, 2018, 10:35:16 pm »
You really aren't making much sense.

If you do not understand what is FFT compared to discrete sine and cosine transform (DFT) then obviously it does not make much sense to you.  |O
All this  delusion about DFT /DCT /Wavelets  arises from misunderstanding basic fact, that FFT is the most efficient, accurate and fastest algorithm.
I have another topic on FFT somewhere on this forum, and I already read and know mr. Ogden opinion. Like DCT - do your project with DCT and we will compare results. I don't like this discussion over and over again about difference between DFT DCT wavelet and anything else. There are things that not everyone would ever understand, despite "correct" vocabulary they use.

Regarding terminology Analog Device used in their data sheet on AD5933, right , I didn't read it attentively, and don't care what they call DCT or DFT. What I was expecting from someone who read DS, is a question how I get 0.01 degree phase error compare to 0.5% stated in DS.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #27 on: September 21, 2018, 10:50:00 pm »
All this  delusion about DFT /DCT /Wavelets  arises from misunderstanding basic fact, that FFT is the most efficient, accurate and fastest algorithm.

I am not sure who is delusional here. You state that FFT is the most efficient, accurate and fastest algorithm to calculate what exactly? Indeed it is most efficient if you are interested in every bin of it's output, but you are not. You are using just one bin. Look, I am not your mother nor your university. If you still did not get it - so be it. Hopefully other readers of our conversation will do the homework and actually check what I am talking about.

Quote
There are things that not everyone would ever understand, despite "correct" vocabulary they use.

Right.  :-DD You use correct vocabulary: FFT?
« Last Edit: September 21, 2018, 11:02:45 pm by ogden »
 

Offline xaxaxa

  • Regular Contributor
  • *
  • Posts: 248
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #28 on: September 22, 2018, 01:47:56 am »
If you multiply your input signal by sine and cosine, then do integrate and dump, the result you get is mathematically equivalent to one frequency bin of your FFT. You can see this just from the formula of the DFT. FFT takes O(n log n) to compute whereas the single frequency DFT takes O(n) even without taking into account memory locality effects, so the integrate and dump is a better choice for this application. Look at my VNA implementation on github (xaxaxa-dev/vna) which does this on an FPGA.
 
The following users thanked this post: ogden

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #29 on: September 22, 2018, 03:11:44 pm »
I intended to get comments from the audience that already posses a knowledge  "theory of operation."

I am afraid that you are only person who knows "theory of operation" of that circuit which most likely is truly your "design".

[deleted]
« Last Edit: September 22, 2018, 03:52:59 pm by ogden »
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #30 on: September 22, 2018, 03:19:39 pm »
If you multiply your input signal by sine and cosine, then do integrate and dump, the result you get is mathematically equivalent to one frequency bin of your FFT. You can see this just from the formula of the DFT. FFT takes O(n log n) to compute whereas the single frequency DFT takes O(n) even without taking into account memory locality effects, so the integrate and dump is a better choice for this application. Look at my VNA implementation on github (xaxaxa-dev/vna) which does this on an FPGA.
I was able to locate your project on github, and download a tar-ball. Can't find dsp processing, where do you calculate phase/magnitude? Is this in fpga? Could I run your dsp core in Qt for evaluation purposes?

I couldn't see any metrological parameters for phase error, have any data?
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #31 on: September 22, 2018, 03:47:00 pm »
Show post.
Can't read you, blacklisted by very nice "Ignore" feature on this forum.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #32 on: September 22, 2018, 03:51:58 pm »
Show post.
Can't read you, blacklisted by very nice "Ignore" feature on this forum.

Ok. You do not deserve my input anymore anyway. Warning to others: his circuit has many flaws, better do not copy it.
« Last Edit: September 22, 2018, 03:58:32 pm by ogden »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #33 on: September 22, 2018, 04:53:16 pm »
For just using 1 or 2 bins (as one also needs the phase) from the FFT it is usually faster to just calculate those 2 bins by DFT. The FFT is very efficient if many bins are needed, like in a spectrum analyzer function, but not for a simple lock in / VNA type measurement.

The advantage of DFT is that is can be done in real time, without even saving all the samples. Its just a few running sums and than from time to time the final result.
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #34 on: September 22, 2018, 05:06:10 pm »
For just using 1 or 2 bins (as one also needs the phase) from the FFT it is usually faster to just calculate those 2 bins by DFT. The FFT is very efficient if many bins are needed, like in a spectrum analyzer function, but not for a simple lock in / VNA type measurement.

 Probably, you didn't read what I already explain using hardware analogy with MUX-ers, that running FFT would reduce noise floor in single bin bucket?  In other words, provides >30 dB (fft-2048) improvements in SNR ratio ?
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #35 on: September 22, 2018, 05:16:00 pm »
The FFT is just an numerical efficient algrorithm calculating the DFT for all the bins. The result is essentially the same for the fourier-transformation for single bins by the basic formula. If at all there might be a minor difference due to rounding effects - here the FFT might be slightly worse. However with a 12 Bit ADC and thus likely 16 bit math, this should not be significant.

I think the hardware analog to the DFT is rather confusing, and might be wrong. Fact is that it does not help all those extra bins by FFT if you don't need them. No SNR gain from calculating all all bins and ignoring it later.
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #36 on: September 22, 2018, 05:43:07 pm »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #37 on: September 22, 2018, 05:49:15 pm »
The same SNR gain as with the FFT also applies to calculating the Fourier components in an other way. So there is the gain from the reduced bandwidth, but this is not exclusive to an FFT.
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #38 on: September 22, 2018, 05:59:56 pm »
The same SNR gain as with the FFT also applies to calculating the Fourier components in an other way. So there is the gain from the reduced bandwidth, but this is not exclusive to an FFT.
No, it's not. Reducing bandwidth is usually done by RF preselectors. To do it in software, there is no alternative to FFT in efficiency. Difference is enormous, compare for example with BP FIR, I 'd estimate for fft-2048 fft is x10^6 times more efficient.
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6905
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #39 on: September 22, 2018, 06:38:13 pm »
This device is limited to series passive DUTs, correct?  It can only work with 2 wire circuits that can be inserted between the source and receiver terminals, so no ground referenced and/or active circuits can be measured - is my understanding correct?
Facebook-free life and Rigol-free shack.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #40 on: September 22, 2018, 06:54:35 pm »
Thermal noise formula:



If you type in bandwidth (delta F) 1KHz, you get −144 dBm. If you type in 1000 times smaller bandwidth 1Hz you get −174 dBm which is exactly 30dB lower value. Yes, FFT so to say splits spectrum into smaller bands and in result noise power for individual band decreases. As already said - it happens disregarding what type of "filtering" used.

[edit] Unless someone quote me, OP will not see what I am telling here about noise. Just saying
« Last Edit: September 22, 2018, 07:14:06 pm by ogden »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14181
  • Country: de
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #41 on: September 22, 2018, 07:01:34 pm »
The same SNR gain as with the FFT also applies to calculating the Fourier components in an other way. So there is the gain from the reduced bandwidth, but this is not exclusive to an FFT.
No, it's not. Reducing bandwidth is usually done by RF preselectors. To do it in software, there is no alternative to FFT in efficiency. Difference is enormous, compare for example with BP FIR, I 'd estimate for fft-2048 fft is x10^6 times more efficient.

The FFT is more efficient, if all bins are needed - but not that much. It depends on how the sin/cos values are provided. With FFT2048 the gain is more around 200 times  (around 2028 / log 2048) if sin / cos values are from a table. However, if only 2 bins are needed (and the others are ignored) it is no more efficient - its more like the direct way is more efficient by maybe a factor of 10. In addition the direct way can use much less memory and thus possibly longer time windows if needed. The FFT would normally be limited by the memory.
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #42 on: September 22, 2018, 10:04:40 pm »
The same SNR gain as with the FFT also applies to calculating the Fourier components in an other way. So there is the gain from the reduced bandwidth, but this is not exclusive to an FFT.
No, it's not. Reducing bandwidth is usually done by RF preselectors. To do it in software, there is no alternative to FFT in efficiency. Difference is enormous, compare for example with BP FIR, I 'd estimate for fft-2048 fft is x10^6 times more efficient.

The FFT is more efficient, if all bins are needed - but not that much. It depends on how the sin/cos values are provided. With FFT2048 the gain is more around 200 times  (around 2028 / log 2048) if sin / cos values are from a table. However, if only 2 bins are needed (and the others are ignored) it is no more efficient - its more like the direct way is more efficient by maybe a factor of 10. In addition the direct way can use much less memory and thus possibly longer time windows if needed. The FFT would normally be limited by the memory.
I will try to explain one more time. I also gonna to put it into first initial message, to help others with the same doubts why is fft?

Lets put 4 dots.

Phase error - > SNR - > Bandwidth - > FFT.

Is it so hard to connect those 4 dots? It's clear, that in order to get minimum phase error, bandwidth must be shrinked as much as possible. FFT here is the most efficient BPF, that allows to cut 244 Hz out of 250 kHz . Now, I 'd repeat last time, there is NO alternative to fft, stop crying about bins that goes to garbage can, fft is doing one specific function: it's sharply cut 244 Hz out of 250 kHz.  Anything else, single bin DFT, Goertzel, FIR etc - don't do this simple task. Easy they are not able to shrink bandwidth, or they are extremely inefficient on a clock cycle scale.

This device is limited to series passive DUTs, correct?  It can only work with 2 wire circuits that can be inserted between the source and receiver terminals, so no ground referenced and/or active circuits can be measured - is my understanding correct?


Good question. Initially, I was thinking to do just capacitor tester, C-V, C-F, ESR, quality etc. That's why 400V capacitor in drawings. To apply high voltage and trace capacitance lost. Than I changed my mind, and decided to complete AD5933 alternative, simple network-impedance analyzer.
 I came to conclusion, that better to leave capacitors in place, to keep DC blocking, doing so any active components could be tested. For example, gain/ phase chart for OPA.  And there is also diodes/ series resistors - for safety, to prevent circuitry from careless operator, since test pad is exposed and anything could goes wrong, external DC , static discharge, high inductance creates huge EMF sparks etc.

 To test active component (amplifier) just connect reference channel - 220 OHm resistor to input, and output goes to 22k resistor. Variable cap shown on a drawings is an example of DUT cap.
22k would creates slight load for amplifier output but it's negligible to any amp I know. And common ground should be connected of course. External DC power for amp (OPA) not limited to -+15 , can be higher up to +400V.

 There are two test connectors,  x100 scale.   DUT is plugged ether between 22k & ground or between 220 & ground. Ground referenced in both cases.   Someone ask me a "theory of operation" , it's  simplest voltage divider. One leg is a resistor, another leg - DUT.  Things that voltage divider is under AC, does not change anything, it's still divider. I would not call it "half bridge" -  do not want to generate more confusion.
 
 
« Last Edit: September 22, 2018, 10:15:02 pm by MasterT »
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #43 on: September 22, 2018, 11:04:18 pm »
Is it so hard to connect those 4 dots? It's clear, that in order to get minimum phase error, bandwidth must be shrinked as much as possible. FFT here is the most efficient BPF, that allows to cut 244 Hz out of 250 kHz . Now, I 'd repeat last time, there is NO alternative to fft, stop crying about bins that goes to garbage can, fft is doing one specific function: it's sharply cut 244 Hz out of 250 kHz.


OMG  :palm:

FFT is not a filter. FFT does not sharply cut it's bins. "Sharp cut" happens only when signal precisely "hits" bin frequency. If incoming signal frequency stand between two bins then both receive power, thus both have nonzero real/imag values after transform. Funny that "FFT vs DFT" topic is written in the chapter "FFT Basics" of the document OP is referring to:

Link to doc: http://www.analog.com/media/en/training-seminars/design-handbooks/Data-Conversion-Handbook/Chapter5.pdf
« Last Edit: September 22, 2018, 11:06:23 pm by ogden »
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #44 on: September 23, 2018, 10:31:56 am »
FFT is just a more efficient way to calculate DFT. It exploits the complex conjugate symmetry and periodicity of exp(-j*2*pi*k*n/N) and produces the same result with far fewer computational steps. You get the same benefits from DFT that you get from FFT, because FFT IS DFT.

It makes no sense whatsoever to use FFT when you're only interested in the results of just 1 or 2 bins. It's faster and less wasteful (in terms of RAM) to use DFT in this case.

FFT here is the most efficient BPF, that allows to cut 244 Hz out of 250 kHz . Now, I 'd repeat last time, there is NO alternative to fft, stop crying about bins that goes to garbage can, fft is doing one specific function: it's sharply cut 244 Hz out of 250 kHz.  Anything else, single bin DFT, Goertzel, FIR etc - don't do this simple task. Easy they are not able to shrink bandwidth, or they are extremely inefficient on a clock cycle scale.
You seem to lack the very basic understanding of what FFT is and how it works. Perhaps this video can clear up some of your misconceptions.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #45 on: September 23, 2018, 01:17:08 pm »
FFT here is the most efficient BPF, that allows to cut 244 Hz out of 250 kHz . Now, I 'd repeat last time, there is NO alternative to fft, stop crying about bins that goes to garbage can, fft is doing one specific function: it's sharply cut 244 Hz out of 250 kHz.  Anything else, single bin DFT, Goertzel, FIR etc - don't do this simple task. Easy they are not able to shrink bandwidth, or they are extremely inefficient on a clock cycle scale.
You seem to lack the very basic understanding of what FFT is and how it works. Perhaps this video can clear up some of your misconceptions.
  I'm not commenting on FFT, there is another thread.
https://www.eevblog.com/forum/microcontrollers/fft-processing-using-ucpu/
Know it better than me, good, be happy.  Stop talking, show your code.  My FFT library  is only 10% of on timing compare to Keil's,  what is yours?
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #46 on: September 23, 2018, 02:54:59 pm »
FFT here is the most efficient BPF, that allows to cut 244 Hz out of 250 kHz . Now, I 'd repeat last time, there is NO alternative to fft, stop crying about bins that goes to garbage can, fft is doing one specific function: it's sharply cut 244 Hz out of 250 kHz.  Anything else, single bin DFT, Goertzel, FIR etc - don't do this simple task. Easy they are not able to shrink bandwidth, or they are extremely inefficient on a clock cycle scale.
I'm not commenting on FFT, there is another thread.
:palm:
Hmm... what could possibly make me think otherwise?

Stop talking, show your code.  My FFT library  is only 10% of on timing compare to Keil's,  what is yours?
Boy, it sure is difficult to acknowledge you were wrong, isn't it?
It doesn't matter how efficient your FFT implementation is, it's never going to be more efficient than a single bin DFT. You can convince yourself that you're right as much as you want, but you're arguing against the laws of mathematics here.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline MasterTTopic starter

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #47 on: September 23, 2018, 03:32:18 pm »
Stop talking, show your code.  My FFT library  is only 10% of on timing compare to Keil's,  what is yours?
Boy, it sure is difficult to acknowledge you were wrong, isn't it?
It doesn't matter how efficient your FFT implementation is, it's never going to be more efficient than a single bin DFT. You can convince yourself that you're right as much as you want, but you're arguing against the laws of mathematics here.
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. There is no issue with pure math, consider ratio: "Bandwidth / Clock_cycles_uCPU".   



I'm not argue, that single bin (6-8 math operation code) is faster than 2048 bins, it's all about bandwidth (second page in a row).
For single bin Bandwidth is 250 kHz. 
 

Offline radioactive

  • Regular Contributor
  • *
  • Posts: 173
  • Country: us
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #48 on: September 23, 2018, 03:42:20 pm »
The Goertzel algorithm is even more efficient than a single-bin DFT.  https://www.dsprelated.com/showarticle/495.php
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Low frequencies Vector Network Analyzer, arduino based.
« Reply #49 on: September 23, 2018, 03:52:46 pm »
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. There is no issue with pure math, consider ratio: "Bandwidth / Clock_cycles_uCPU".

 :-DD

LOL it is already said here in this thread. He not only ignores my posts but most likely ignore posts of everybody but him:

If you multiply your input signal by sine and cosine, then do integrate and dump, the result you get is mathematically equivalent to one frequency bin of your FFT. You can see this just from the formula of the DFT. FFT takes O(n log n) to compute whereas the single frequency DFT takes O(n) even without taking into account memory locality effects, so the integrate and dump is a better choice for this application.

[edit] Please somebody poke him with xaxaxa post
« Last Edit: September 23, 2018, 04:28:21 pm by ogden »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf