Test and Measurement Forum

Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Wed Jun 27, 2018 11:23 pm

WMAlbers wrote:Hello Aaron,
I am a new user hobbyist of the picoscope (2204A). The FRA analyzer you provided works well. Very usefull tool! I only want to check if the magnitude is voltage or power based Decibels... I need to convert the Decibels back to peek voltage ratio, so as to be able to further compute the impedance modulus of my test setup. The application is generally testing of loudspeakers I repair/build.
Best greetings,
Martin Albers


Hi Martin,

Thank you for the feedback. The dB scale is voltage based: 20 log(Aout/Ain), Ax = Amplitude of the DFT on the voltage signal.

Aaron.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby _Wim_ » Thu Jul 12, 2018 12:46 pm

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.
_Wim_
Newbie
 
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Postby Memdoki » Mon Jul 16, 2018 6:47 am

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!
Memdoki
Newbie
 
Posts: 0
Joined: Mon Jul 16, 2018 6:26 am

Re: Frequency Response Analyzer with Bode Plots

Postby Martyn » Mon Jul 16, 2018 7:55 am

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
Martyn
Site Admin
Site Admin
 
Posts: 3155
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Frequency Response Analyzer with Bode Plots

Postby Memdoki » Mon Jul 16, 2018 10:17 am

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.
Memdoki
Newbie
 
Posts: 0
Joined: Mon Jul 16, 2018 6:26 am

Re: Frequency Response Analyzer with Bode Plots

Postby Barnett » Mon Jul 16, 2018 4:26 pm

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
Barnett
Newbie
 
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Thu Jul 19, 2018 2:38 pm

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
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby Barnett » Thu Jul 19, 2018 2:49 pm

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
Barnett
Newbie
 
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Postby _Wim_ » Fri Jul 20, 2018 6:22 am

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...
_Wim_
Newbie
 
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Postby Barnett » Fri Jul 20, 2018 3:19 pm

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
Barnett
Newbie
 
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

Re: Frequency Response Analyzer with Bode Plots

Postby _Wim_ » Fri Jul 20, 2018 7:19 pm

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...
_Wim_
Newbie
 
Posts: 0
Joined: Sun Nov 12, 2017 11:31 am

Re: Frequency Response Analyzer with Bode Plots

Postby sbabic44 » Sat Jul 21, 2018 3:44 pm

You should look up Goertzel algorithm and try to understand it first.. Neat stuff!
sbabic44
Active User
Active User
 
Posts: 15
Joined: Thu Nov 30, 2017 10:17 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Mon Jul 23, 2018 4:07 pm

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: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Mon Jul 23, 2018 4:17 pm

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.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby Barnett » Mon Jul 23, 2018 4:44 pm

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.
Barnett
Newbie
 
Posts: 0
Joined: Mon Nov 07, 2016 5:20 pm

PreviousNext

Return to Applications

Who is online

Users browsing this forum: No registered users and 0 guests