pavel-demin / red-pitaya-notes

Notes on the Red Pitaya Open Source Instrument
http://pavel-demin.github.io/red-pitaya-notes/
MIT License
337 stars 209 forks source link

Do not succeed to use the VNA app in transmission mode to measure filters #678

Closed satfan52 closed 6 years ago

satfan52 commented 6 years ago

Hello Pavel,

I am trying to use the VNA app to measure filters but I have not much success, at least compared to the standard "frequency response analyzer" app that gives much better results. The set up that I use for the measurement is identical in the two experiments (frequency response analyser & VNA) . I use a 10db attenuator on the output side of the RP and 50 ohm load on the input side of the RP to present an impedance as close as possible to 50 ohms. The attenuator and the 50 ohm load are attached to the DUT and connected with good quality and short SMA cables to the RP. I checked the open, short, load and DUT data and I see nothing unusual. It is the GAIN OPEN and GAIN SHORT tabs that provide strange results. I would like to use the VNA for all my RF measurements but because of this problem, I just can't and must fallback to the standard frequency response analyzer app. See pictures below

Regards Peter

screenshot from 2018-02-26 21-52-03 screenshot from 2018-02-26 22-09-21 screenshot from 2018-02-26 22-09-28

pavel-demin commented 6 years ago

Hello Peter,

Thank you very much for these tests.

If I understand correctly your setup, then I'd say that only the 'Gain short' tab is usable with this setup and the short calibration should be done with the attenuator directly connected to the 50 Ohm load.

Could you please explain me how you calibrate both applications?

I didn't look at the 'Frequency Response Analyzer' application before. It's good to know that it works and that its source code is available. So, I can try to implement a similar algorithm in my VNA application.

For my information, here are some links:

Best regards,

Pavel

pavel-demin commented 6 years ago

Looks like the gain calculation algorithms used in both applications are very similar:

https://github.com/pavel-demin/red-pitaya-notes/blob/master/projects/vna/client/vna.py#L662 https://github.com/RedPitaya/RedPitaya/blob/master/apps-free/freqanalyzer/src/dsp.c#L199

In both applications, the frequency response is calculated as the DUT signal amplitude over the short signal amplitude.

satfan52 commented 6 years ago

Dear Pavel,

I have tried two different set-up with the VNA app and I have obtained the same results

Please refer to the pdf document attached that disrcribes the two set-ups that I have used for the VNA app as well as the calibration procedure

set-up.pdf

For the "frequency response analyzer" app, the set-up is simpler as there is no need for a second SMA-T (see in the document enclosed, SMA-T2 in the first set-up, the 3 bead reflexion reflexion bridge in the second set up). I just hit the calibrate button of the Frequency response app with SMA-T1 connected directly connected to the -10dB attenuator. Then to make the measurement I just insert the filter bewteen SMA-T1 and the attenuator and that is it.

Ideally I would like to use the VNA app for all measurements, so thanks for letting me know what I am doing wrong since the problem does not seems to be with the software.

Regards Peter

pavel-demin commented 6 years ago

Dear Peter,

Thank you for the detailed description of the calibration procedure.

I'd say that in the set-up 1 the 'Gain open' tab should work.

However, I'd try an even simpler set-up:

If it doesn't work, could you please send me the .ini files for some of these set-ups? The .ini files contain the calibration and the measurement data. With these data, I'll try to check the gain calculations.

Best regards,

Pavel

satfan52 commented 6 years ago

Hello Pavel,

I have done the test that you suggested and unfortunately the result obtained is the very same than with the procedure that I followed, it is actually much faster to do (thanks for pointing out the shortcut). I attach the picture and the cfg files of my test.

Regards Peter

screenshot from 2018-02-27 20-10-24 screenshot from 2018-02-27 20-07-13 screenshot from 2018-02-27 20-05-40 vna.ini.zip vna.csv.zip

pavel-demin commented 6 years ago

Hello Peter,

Thank you for the ini file.

The VNA client for MS Windows (vna-win32-20171130.zip) works fine: gain-short

When I run the VNA client under Ubuntu 16.04, I obtain exactly the same results as you did.

The numpy versions are 1.13 in vna-win32-20171130 and 1.11 under Ubuntu 16.04. numpy.interp in 1.11 doesn't support complex values. I've just added a workaround with this commit.

You can apply this fix by downloading vna.py to the VNA client directory.

Best regards,

Pavel

satfan52 commented 6 years ago

Hi Pavel,

Yes!! this solves the problem in my linux Ubuntu 16.04 environment. I tested successfully your fix. By the way, I am impressed with the dynamic range of my measurements with your VNA software, it is quite close of the theoretical limit of 84 dB for a 14bit DAC. Thanks Again Regards Peter

pavel-demin commented 6 years ago

The code that fixes compatibility with older NumPy versions is now in the latest release.