05-15-2007 07:00 AM
05-15-2007 08:23 AM
Make it a waveform and use extract tone or a FFT Power spectrum to get the frequency components of the wave.
Paul
05-15-2007 08:28 AM
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
05-16-2007 04:49 AM
05-16-2007 05:09 AM
05-16-2007 07:55 AM
05-19-2007 05:19 AM
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
05-21-2007 11:49 AM
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
05-22-2007 04:02 AM - edited 05-22-2007 04:02 AM
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
05-23-2007 08:51 AM