Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing
Post Reply
hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

Barnett wrote:The main thing I have learned is that you are using the Fourier math to act like precision filters at each test frequency. For example if your test frequency is at 1 Khz you are only concerned with 1 Khz parts of the input and output. Anything else is rejected.
Yes, this is an accurate viewpoint. Sometimes the Goertzel is even referred to as a filter (IIR). Though, it does produce an identical mathematical result as the DFT (naive, or FFT), assuming infinite precision arithmetic. This is useful in measuring its numeric accuracy, as with this application: (https://bitbucket.org/hexamer/testgoert ... nators.git). Another interesting viewpoint is that of a resonator (see Clay Turner's publications on the topic): http://www.claysturner.com/dsp/digital_resonators.pdf
Barnett wrote:Having trouble finding anything on Reinsch math in Wiki.
If you think about it, the Reinsch improvement is pretty esoteric. Except in extreme cases of low precision arithmetic and/or very long input sequences, it's fairly irrelevant. Wikipedia does cite a reference to Reinsch in Bulirsch and Stoer, which is the only academic textbook treatment I know of. If I recall correctly, there are only a couple of pages on it. There are a handful of other academic papers in the realm of numerical accuracy, but it's a pretty obscure topic.

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Thanks for putting notes in the code that explains things and gives references. I have been studying the Goertzel math and have found that they use it a lot in decoding tone signals like in telephone dialing systems. Just got a 2208B Picoscope and am getting used to it. I plan on running Bode plots on switch mode power supplies and need to get down to 10 Hz. What settings would you recommend?
Noise Reject Mode: on
Min Cycles captured: 16
Low noise oversampling: 64
Noise reject bandwidth: 6
Noise reject timebase: ? (supply is running at 40 khz)

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

Charles,

I'll comment a little bit on your settings, but overall it is important to have a prediction of what the response will look like. In particular, what do you expect the maximum amplification/attenuation to be? Also, how noisy is the data in the time domain? These factors will help determine the stimulus level and whether adaptive stimulus mode might help.

On the settings:
1) Low noise oversampling is actually not relevant for Noise reject mode. Leaving it at 64 is OK.
2) As you change the Noise reject timebase, there is a field just below it that indicates how low of a stimulus frequency you'll be able to achieve. Based on a similar scope, an experiment shows that a timebase of 5 will allow you to get down to about 9.936 Hz, so 10 Hz would be achievable. But please double check with your scope.
3) As for bandwidth, going as low as 6Hz would be fine, but it may not be necessary. Lower bandwidths will require more samples, and thus more time. 10 Hz would generally be OK.

I may have missed some things from Roland's recommendations, so it might be worth another look at his excellent video.

Thanks,

Aaron.

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello Aaron,
Thanks for your help. I will send you a Bode plot when I get things running.

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello Aaron, I am having problems on two different computers. Can you see if you can figure out what I am doing wrong?

Windows XP / USB 2.0:
Status: 2208B S/N: FR749/0155 successfully initialized.
Status: Starting frequency step 1 (9.998 Hz)
Fatal error: Failed to retrieve aggregated data for peak/overvoltage detection: 70
Fatal error: Failed to setup stimulus signal: 46
Error: Failed to disable signal generator.

Windows 10 Pro / USB 3.0
Error: No compatible PicoScope device found.

mnni
Newbie
Posts: 1
Joined: Mon Oct 09, 2017 7:33 am

Re: Frequency Response Analyzer with Bode Plots

Post by mnni »

Hey Aaron

Is it possible that you could provide the binaries for the PLplot and QT as it looks like they are made for VC++ 2012 the ones found on the download page- resulting in compiling errors when I try to build from source.

thanks for nice and well documented code by the way.

regards Martin

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello Aaron. Got the FRA working on the first computer. Forgot to install the 32 SDK. Still working on the other one. Can you tell me the best way to be able to send you a screen shot of the bode plot using the forum? Thanks Charles

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

Hi Charles,

Sorry you're experiencing issues. Let's start with some basic questions ...

1) Do you have the 32bit Pico SDK installed on both computers?
2) is the issue on the Win7 machine persistent/repeatable?
3) What version of the FRA app is installed on each computer?

If those answers don't provide clues, there is a newer unreleased version of the app that has significantly increased diagnostics that I will ask you to try.

Thanks,

Aaron

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello Aaron,
The FRA on Windows 7 computer is working fine after installing the 32 SDK. The computer with Windows 10 has this error: Unable to initialize device with serial number FR749/0155.
PicoSDK_32_10.6.12.41
FRA 0.6.0.0
Thanks / Charles

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

This relates to the Goertzel algorithm used in the FRA. Does anybody have an Excel spreadsheet on the Goertzel algorithm? Need something simple that could work with say less than 10 samples. Thanks / Charles

Memdoki
Newbie
Posts: 0
Joined: Mon Jul 16, 2018 6:26 am

Re: Frequency Response Analyzer with Bode Plots

Post by Memdoki »

hi hexamer

We want to make a bode plots with the PS5444D,but now the software isn't support,
so we buy a PS2204A,it can be connected and initialized successfully,
but i find one problem that when i set stop frequency 1MHz,the log as below:

Status: 2204A S/N: FO576/544 successfully initialized.
Stop frequency must be <= 100000.0
Error: Invalid inputs.

so can you give me some help?
thanks a lot!

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Frequency Response Analyzer with Bode Plots

Post by Martyn »

The maximum output frequency of the 2204a signal generator is 100kHz, the software is just telling you that.
Martyn
Technical Support Manager

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello Aaron, This is on my Windows 10 pro computer. Loaded FRA 0.6.1 and it stepped through the frequencies like it is supposed to but would not generate the graph. It showed the following error.
PLplot error generating Bode plot: Unable to either (1) open/find or (2) allocate memory for the font file.

FRA4PicoScope 0.6.1.msi
PicoScope6_r6_13_6.exe
PicoSDK_32_10.6.12.41.exe

Thanks / Charles

Barnett
Newbie
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hey Aaron,
It is not making the graph and gives the following error message.
PLplot error generating Bode plot: Unable to either (1) open/find or (2) allocate memory for the font file.
Any idea on how to fix it?
Thanks / Charles

hexamer
Advanced User
Advanced User
Posts: 5
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

mnni wrote:Hey Aaron

Is it possible that you could provide the binaries for the PLplot and QT as it looks like they are made for VC++ 2012 the ones found on the download page- resulting in compiling errors when I try to build from source.

thanks for nice and well documented code by the way.

regards Martin
Sorry for the delay, Martin. I have now replaced the older versions with the ones I am currently using for building with VS2015.

The contents of qtlibs.zip (4 files) go directly into the FRA4PicoScope\lib directory
plplot_install_debug.zip and plplot_install_release.zip will unzip into folders that should also reside in FRA4PicoScope\lib directory.

Please let me know if you have any problems.

Post Reply