Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing
Post Reply
_Wim_
Advanced
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Post by _Wim_ »

Maybe also a nice idea to implement: "impedance analyzer functionality" like on the Analog Discovery board

If I understand correctly, the only difference would be to allow the user to enter the value for the used reference resistor, and to rescale your plot accordingly. You can off course calculate the impedances from your plots already when you know the reference impedance, but the visual representation is nice.

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 used FRA4PicoScope 0.6.1 to connect PicoScope 5444D,but the log shows "Error: Unable to initialize device with serial number GP806/0015",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 »

We haven't released the SDK to support the 5000D models yet, it should appear on the website shortly, hence the reason the scope isn't seen.

As the FRA is a 32 bit application you should be able to take the ps5000a.dll from the PicoScope installation directory and drop it into the FRA application directory.
Martyn
Technical Support Manager

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

Re: Frequency Response Analyzer with Bode Plots

Post by Memdoki »

Martyn wrote:We haven't released the SDK to support the 5000D models yet, it should appear on the website shortly, hence the reason the scope isn't seen.

As the FRA is a 32 bit application you should be able to take the ps5000a.dll from the PicoScope installation directory and drop it into the FRA application directory.
Hi Martyn
ok,thanks a lot for your reply.

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 making the FRA ap. I plan on ordering a 2208B scope and use it to check gain / phase on power supplies. Do you have any info that shows how you made this FRA ap? I would like to understand how you made the program and how you use the DFT in the code. 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 »

Barnett wrote:Hello Aaron,
Thanks for making the FRA ap. I plan on ordering a 2208B scope and use it to check gain / phase on power supplies. Do you have any info that shows how you made this FRA ap? I would like to understand how you made the program and how you use the DFT in the code. Thanks / Charles
Charles,

Thank you for the feedback. I don't have alot of external documentation on the overall design (some is scattered throughout this thread), but the code is open source and well documented, especially the DFT parts. If you could explain what goal you have in mind, I might be able to give you better information.

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 have spent the last two years studying Fourier analysis and would like to know how you use the DFT in your FRA program. I am at a very basic level when it comes to programming. To me it seems like this is what is happening:
1. Generate the step frequency.
2. Measure chA & chB.
3. Calculate gain as chB/chA and plot this as a point on the gain graph.
4. Calculate the difference in phase and plot this as a point on the phase graph.
5. Repeat using the next higher frequency.
Maybe you could show me the steps that you used to do this.
Thanks again / Charles

_Wim_
Advanced
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Post by _Wim_ »

Hi Barnett,

I think even as a non programmer, all the information you need is quite readable in this part of the source code:

https://bitbucket.org/hexamer/fra4picos ... ew-default

The most interesting parts are near the bottom of the file (CalculateGainAndPhase, InitGoertzel, FeedGoertzel and GetGoertzelResults...

Have fun reading...

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

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Hello and thanks for the reply. I have printed out the amazing code and can understand some of it. Can you please tell me why Fourier math is required to do this? Thanks again / Charles

_Wim_
Advanced
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Post by _Wim_ »

Barnett wrote:HCan you please tell me why Fourier math is required to do this? Thanks again / Charles
I am not sure if I understand your question, but if you want to measure the amplitude of a specific frequency only, I think fourier or simular mathematical function is necesarry. Oted herwise the measured amplitude includes distorsion and noise also...

sbabic44
User
User
Posts: 3
Joined: Thu Nov 30, 2017 10:17 pm

Re: Frequency Response Analyzer with Bode Plots

Post by sbabic44 »

You should look up Goertzel algorithm and try to understand it first.. Neat stuff!

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:Hello Aaron,
Thanks for your help. I have spent the last two years studying Fourier analysis and would like to know how you use the DFT in your FRA program. I am at a very basic level when it comes to programming. To me it seems like this is what is happening:
1. Generate the step frequency.
2. Measure chA & chB.
3. Calculate gain as chB/chA and plot this as a point on the gain graph.
4. Calculate the difference in phase and plot this as a point on the phase graph.
5. Repeat using the next higher frequency.
Maybe you could show me the steps that you used to do this.
Thanks again / Charles
This is pretty close. Step 2 is capturing the data with the scope. Steps 3 and 4 would be better characterized as

(a) run DFT on input and output captured data (which can be done simultaneously due to SIMD). This results in a single complex vector per input/output as the result
(b) compute amplitudes of input and output from the complex vectors from a: gain = output/input
(c) compute phases of input and output from the complex vectors from a: phase = output - input

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 »

sbabic44 wrote:You should look up Goertzel algorithm and try to understand it first.. Neat stuff!
Goertzel, especially the generalized version published by Sysel and Rajmic, is ideal for this application. The main downside is having to deal with error growth. In a practical sense, it's only a concern with huge sample buffers (think PS6000 with a very narrow bandwidth setting or @ low stimulus frequency), but it does need to be handled. I have another project on Bitbucket that explores that topic. There are some sophisticated ways of dealing with this, but using alternative resonators (Reinsch) works well.

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

Re: Frequency Response Analyzer with Bode Plots

Post by Barnett »

Thanks to all.......
I have gone over the Rolandvanroy paper that is in this forum and found it very useful. Currently studying the Goertzel alogorithim. I have done some Arduino so a little of the code is recognizable. 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. Having trouble finding anything on Reinsch math in Wiki.

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 »

_Wim_ wrote:Hi Barnett,

I think even as a non programmer, all the information you need is quite readable in this part of the source code:

https://bitbucket.org/hexamer/fra4picos ... ew-default

The most interesting parts are near the bottom of the file (CalculateGainAndPhase, InitGoertzel, FeedGoertzel and GetGoertzelResults...

Have fun reading...
Yes, that's definitely where the DFT is explained, as well as all the rationale for Goertzel/Reinsch.

Also, another part very relevant to the signal processing is the sampling logic. In the provided link, that's lines 1528-1577.

Post Reply