LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

estimate frequency response

Hello
 
I want to use the estimate frequency response tool to plot a bode diagramm. I read in a file which content a stimulating signal (a sine funktion with a changin frequency) and a response signal (an angle diffrence). But i get only unusefull things. Can somebody recommend a case study or schow me a better solution for this type of meassurement?
Thank you much
Marco
0 Kudos
Message 1 of 15
(4,319 Views)

Make it a waveform and use extract tone or a FFT Power spectrum to get the frequency components of the wave.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 15
(4,307 Views)

If the frequency is changing with time you will have to analyze a time sampling on scale with the change, that is dont get the frequency for the whole collection time.  For a bode response you might want to sample descrete frequency stimulus points ie, 1,2,4,8,16,32,64, 128 kHz and extract the major frequency component from each of these response samples.  I think normalizing the response frequencies to the 1st sample might help as well.  I am no expert in signal processing but have completed many projects which required similar processing.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 15
(4,305 Views)
hello again...
i am not able to solve the problem atm.
Can somebody send me an simple example-vi ?
0 Kudos
Message 4 of 15
(4,286 Views)
Hi, I need a similar example.

I have a fixed frequency sinewave and a response to it that lags the sinewave. I need to compute Phase shift & magnitude. Has anybody done anything similar?

Thanks

s
0 Kudos
Message 5 of 15
(4,285 Views)
Marco,
 
First of all, to be able to identify the frequency response of a system, you have excite the system in all frequencies that you interested in. By your description, it is not clear if you have swept signal or just a sine wave with two or three frequencies. However, if you have, lets say, 5 to 10 different frequencies and you are able to measure input and output, you can detect the amplitude different and phase shift and plot the frequency response.
 
If you are looking for a more automated way to obtain the frequency response of a signal, you could use the "Basic Multitone and Amplitude.vi" to create a range of frequencies, apply this to the system, read the result and use the "Frequency Response Function (Mag Phase.vi" (FRF) to obtain the frequency response. There is an example shipping with LabVIEW (FDS and PDS) called "Multitone with Amplitude " that has a very similar example. You just need to change the FFT by the FRF.
 
If your system behave better with stochastic or random signals or you can apply step functions to it, maybe you could use the System Identification Toolkit (purchase separated) to identify the transfer function of the system. This tookit has more robust algorithms and you could even identify the transfer funtion point-by-point.
 
Hope this helps!
Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 6 of 15
(4,271 Views)

Thank you Barp for your reply. The stimulus is a swept sine function (0.1Hz to 20Hz, linear sweep) and I am reading the output through an encoder. I would like to plot the magnitude and phase plots (or bode plot) of the system. I used an FRF block which gives a starting freq, resolution freq. df, and Magnitude (similar data for the phase). I would like to plot the amplitude vs. frequency in a loglog scale (or Bode plot).  I am not sure how to use the starting frequency, df, and Magnitude to generate such a graph. Thanks again for your help.

 

Marco

0 Kudos
Message 7 of 15
(4,241 Views)

Hi Marco,

Once you are able to obtain the correct f0, df, and magnitude data from your Frequency Response Function, you can easily plot this data to a Waveform Graph. On your Front Panel, right click to open the Controls Palette and select Graph >> Waveform Graph. Wiring the "magnitude" output of your Frequency Response Function to the graph on the block diagram should allow you to display the bode plot.

You can use the View input on the Frequency Response Function to set the output to display in dB. Right click on your Waveform Graph and choose Properties, then select Scales >> Log to view your Bode plot in the standard format.

I hope this helps!

Casey Weltzin
Applications Engineer
National Instruments

0 Kudos
Message 8 of 15
(4,177 Views)

That is exactly what I did. However, the graph looks wrong. Which means that my f0 and df are not correct. So, I created data using Matlab/simulink. I used a chirp signal (0.01 Hz – 20Hz). I collected data from a known system at the rate of 1000 samples/sec. I fed the data to an FRF block and set “dt” of the signal X to 0.001 and the same for signal Y (I did not change any of the other values on the front panel of the FRF subvi). I attached the Mag output of the FRF block to a wave graph, but the output does not look correct. I examined f0 and df  and they are equal to 0 and inf, respectively. I would like to add that the frequencies shown on the bode plot are completely wrong, I expected them to go from 0.01 to 20 (Hz) instead they go from 100u to 1.0. I attached to the data file that I am using (column 1: time, column 2: input signal, column 3: output 1, column 4: output2).

Thank you for your help.

 

Message Edited by gaertner.marco on 05-22-2007 04:05 AM

Message Edited by gaertner.marco on 05-22-2007 04:06 AM

Message Edited by gaertner.marco on 05-22-2007 04:08 AM

Download All
0 Kudos
Message 9 of 15
(4,166 Views)
I think your VI is nearly complete, but the f0 and df of the FRF output definitely indicates that something is incorrect. After taking a look at your VI and plotting each of the four channels of data that you are reading in (directly after reading in data from your file), I noticed that the dt of the final channel (output2) is one second instead of the 0.001 seconds that it should read.
 
I think that the Split Signals VI is correctly setting the time information for the first channel (input signal). However, Split Signals doesn't appear to correctly set the time data for the other channels. Instead, data is essentially being plotted vs sample number. To fix this, double click on the Read from Measurement File express VI, and select the option "First column is time channel." Next, since the time data will no longer appear as output data from the Signals output, obtain the two signals of interest (input signal and output2) from outputs 1 and 3 of the Split Signals function. I have tested this, and the Frequency Response Function now appears to generate correct data.
 
As a side note, though dynamic data wires are a convenient feature, it is sometimes easier to see what is going on within the program when using explicit data types such as waveform, etc. Using the Convert from Dynamic Data function, you can extract any one of your data channels out of the dynamic data wire without having to expand out all channels with the Split Signals function.
 
I hope this helps!
 
Casey Weltzin
Applications Engineer
National Instruments
0 Kudos
Message 10 of 15
(4,116 Views)