LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bode plots via FFT's trouble??

Solved!
Go to solution

I have constructed a VI to construct MAG/PHASE plots via use of FFT's from the signal processing pallette.  It is a small VI & seems somewhat straightforward.  However, to check if everything is working correctly I constructed a fictitious 2nd & 5th order pole system to which I know the transfer functions:  10/s+10(1/(s+0.5)+1/(s+0.5)+1/(s+0.5))+1/(s+0.5))

 

2nd order system:10/s+10(1/(s+0.5)  Note that these 2 systems are decaying exponentials in the time domain.

 

I have included a screenshot of my results & attached my VI along with the data file for the input to the VI.  Refer to the screenshot for the appropriate settings.
You can see in the time domain charts that indeed the 5th order system decays faster than the 2nd order system.  However, the freq plots do not reflect this.  I presume I am doing something incorrectly with the FFT that skews the results.  Note that I did no magnitude nor frequency scaling.  In fact the freq axis corresponds to the #samples in the data set.  If I converted to freq I presume my frequency resolution would correspond the sampling freq/#samples which for this data set is 1/dt = 1 kHz divided by 10000 samples which is 0.1Hz.  Even if I convert to freq the slope of both systems will still be =.
My speculation is I must be missing something very fundamental in scaling the magnitude correctly for the FFT so that the slopes for the 2 systems are actually different in the freq domain as well.
Appreciate any feedback!!!!!!!!!!!
0 Kudos
Message 1 of 8
(5,311 Views)
WHOOPS, I forgot the data set.  It is attached here.
0 Kudos
Message 2 of 8
(5,310 Views)

Hi tsunami,

 

From my experience using FFTs, they are typically used on a signal that oscillates to find the frequencies that compose the signal.  However based on the two time domain graphs, it looks like these signals do not oscillate. Can you bring me up to speed as to why you are using an FFT?  

 

You may want to check the data going into the FFT too- to see if the out put is logical.  I would try some things myself, but the  "create_ramp" subVI is missing.

 

Kristen H.

0 Kudos
Message 3 of 8
(5,266 Views)

Sorry Kristen, that RAMP function was buried inside the INTERPOLATION vi so I overlooked that.  I have attached it here.  It is in the intpxmpl.llb.  I also included a copy under a different name so if you cannot get the create_ramp inside the .llb file you could simply insert the copied vi.

 

As to the use of FFT on a non-periodic signal.  True if the signal is periodic FFT's are fairly straight forward.  However, with some trickery FFT's can also generate mag/phase info for a non-periodic signal if you assume your observation window has a sufficiently long period such that all transients have died out.  So I am attempting to figure out freq spectrum info on the transients in my non-periodic signal which is obtained experimentally.

 

So to see if I could do this & check if the output makes any sense I created the fictitious transfer functions listed in my 1st posting.  That transfer function is also non-periodic but note that even non-periodic signals possess their own Fourier transform in the continuous domain.  Unfortunately, since time data is a discrete representation of a continuous signal it is necessary to process it via FFT.  At least that is my understanding.

 

So essentially I am attempting to infer a continuous spectrum from a discrete data set.  Does that make any sense?  I am no expert at this but I believe the tranfer function in the s-domain, commonly referred to as the LaPlace transform, has its Fourier counterpart where the REAL part of s = 0 & the IMAGINARY part = jw.  So if I know the transfer function I can infer how the system would behave if excited harmonically.

 

I hope I verbalized my thoughts coherently & you follow my rationale.

Download All
0 Kudos
Message 4 of 8
(5,253 Views)

Kristen, if my rambling in my previous reply is confusing maybe this might help.  There are materials that are called "viscoelastic" & rubber falls into that class.  They evaluate viscoelasticity in several different test methods.  Some are static while others are dynamic.  My reseach group is attempting to correlate static & dynamic test results.  Our arguments that the static tests can also yield dynamic behavior if you make the argument that the static tests are responses to an input step function.  If that can be argued then the derivative of that response would be equivalent to the impulse response of the material.  If you know that then you can convolve that spectrum with any signal & get the predicted behavior presuming linear behavior.

 

Maybe this sheds light on your ?

0 Kudos
Message 5 of 8
(5,243 Views)

To avoid any confusion, the time domain signal that corresponds to the 2 transfer functions in the 1st posting is:

 

10H(t)+10(exp(-0.5t))

10H(t)+10(exp(-0.5t)+exp(-0.5t)+exp(-0.5t)+exp(-0.5t))

 

The data text file attached in the 2nd posting is the discretized time domain signal which is then fed into the FFT's.

0 Kudos
Message 6 of 8
(5,209 Views)

Just to check what the magnitude spectra should look like I used MATLAB (see attached).

 

As stated earlier the 2 systems I am comparing:

10/s+10(1/(s+0.5) 

10/s+10(1/(s+0.5)+1/(s+0.5)+1/(s+0.5))+1/(s+0.5))

 

You can see that the MATLAB output correctly distinguishes between the 2 systems.  What is incorrect about my LABVIEW VI????

0 Kudos
Message 7 of 8
(5,192 Views)
Solution
Accepted by topic author tsunami
It appears I resolved my own problem.  I was utilizing the FFT's correctly all along.  I had my analytical model incorrect.  The FFT's were telling me this all along but I doubted that I was using them correctly instead of questioning my analytical model.
0 Kudos
Message 8 of 8
(5,178 Views)