DIY Network Analyzer / Bode Plotter with Oscilloscope and Function Gen - Page 1
Forum section: electronics / projects

author: alterbaron
author_rank: Contributor
timestamp: August 21, 2015, 06:49:58 am
content: Hi all,Here's a fun afternoon project: making something analogous to a network / impedance analyzer by automating a DSO (Siglent SDS1072CML) and a 2-channel function generator (Siglent SDG1025).The basic schematic is below:The idea is to have the generator produce two in-phase signals. One of these signals acts as a phase reference, and is delivered straight to one of the channels of the oscilloscope. The other signal goes to the DUT. After passing through the DUT, the signal goes to the oscilloscope through a 50-ohm thru-termination.I used computer control through USB to automate data collection with MATLAB. A script running on my PC adjusts the function generator output, adjusts the vertical and horizontal scale on the oscilloscope to get a good measurement, takes amplitude and phase measurements, then repeats.Here's the MATLAB code, which uses the instrument control toolbox:LINK on GitHub GistHere's a picture of the test setup in action:(The metal box contains a breadboard which is host to a simple LC bandpass filter. The box prevents outside interference from getting in and affecting the measurement.)And here's the resulting bode plot:The bandpass filter operates nicely up to about 2.5MHz, where the capacitor hits its self-resonant frequency.With a directional coupler, it should be possible to measure return loss using this setup. I'm curious to see how well it performs in future experiments. Stay posted!Thoughts / ideas / comments?

author: tggzzz
author_rank: Super Contributor
timestamp: August 21, 2015, 07:15:29 am
content: If you use a "splitter combiner" then you only need a single channel sig gen.For a simple 25-1500MHz scalar network analyser (i.e. no phase measurement), you can use a noise source and SDR dongle; cost is £32/$48. Seehttps://entertaininghacks.wordpress.com/2015/08/10/measuring-rf-filters-with-a-homebrew-1-5ghz-scalar-network-analyser-costing-3248/for what can and cannot be achieved

author: alterbaron
author_rank: Contributor
timestamp: August 21, 2015, 07:46:55 am
content: Quote from: tggzzz on August 21, 2015, 07:15:29 amGood point! Though most splitters that cover this frequency range only operate down to a few hundred kHz, so it tends to limit low-frequency performance.I tried a sweep using my mini-circuits ZMSC-2-1 splitter, which has a minimum operating frequency of 100kHz. Here's the result:The plot matches the result obtained by using both channels of the generator.

author: MagicSmoker
author_rank: Super Contributor
timestamp: August 21, 2015, 02:19:05 pm
content: While interesting in and of itself, I question the practicality of this for anyone outside of academia or a large business that already owns (and is proficient at using) MATLAB + Simulink because that is one expensive software package (around $20k, IIRC).

author: hs3
author_rank: Regular Contributor
timestamp: August 21, 2015, 02:32:05 pm
content: Quote from: MagicSmoker on August 21, 2015, 02:19:05 pmThe code (https://gist.github.com/anonymous/d21020a91359a98f42da) doesn't look extremely complicated so I assume it shouldn't be impossible to port it to Octave or Scilab for example.https://www.gnu.org/software/octave/http://www.scilab.org/

author: alterbaron
author_rank: Contributor
timestamp: August 21, 2015, 04:26:53 pm
content: I think it should be possible to usePyVISAto do this for free.I'll have to try it out later.But yeah, MATLAB is definitely inaccessible for the hobbyist. It's great for prototyping though. Now that I have a bit more of a feel for how this stuff works, it should be easy to port it to anything else.Quote from: MagicSmoker on August 21, 2015, 02:19:05 pmSimulink wasn't used, just the MATLAB instrument control toolbox being used to control the USBTMC instruments.

author: hendorog
author_rank: Super Contributor
timestamp: August 27, 2015, 07:04:17 am
content: Cool!Perhaps changing the phase 180 degrees and subtracting that from the initial measurements would increase accuracy further. That should cancel out drift and offset.Could you use the digital filter in the scope to reduce harmonics and noise?