01-22-2013 10:02 AM
Hello all,
I'm performing a simple measurement: I measure frequency response using swept sine VI from sound and vibration package. I simply wire output signal to two input terminals (stimulus and response chanels) - so I should get frequency response magnitude equal to "1" at all frequencies and phase equal to "0" at all frequencies. However due to the fact that my PCI card (PCI 6251) is not able to record data simlutaneously, there is a phase shift which rises linearly with frequency. Is there a simple way to correct this?
thanks!
martin
Solved! Go to Solution.
01-22-2013 01:25 PM
You can customize the interchannel delay in DAQmx by setting the AI Convert Clock Rate. http://digital.ni.com/public.nsf/allkb/65E7445DB1AA5DC586256A410058697B?OpenDocument&nisrc=LV-2012
Simultaneous sampling devices such as Dynamic Signal Acquisition devices should be used to guarantee (in hardware) simultaneous sampling.
If you are satisfied that the current hardware configuration is optimal for your application, you can compensate the Swept Sine phase output using the Sound and Vibration function:
SVFA Compensate Phase for Time Delay (XY) (1 Ch).vi
01-23-2013 04:53 AM
Great!
thank you very much!
martin
09-13-2016 04:59 PM
How would you exactly implement this in a swept sine VI?
Thanks,
09-14-2016 02:02 AM
Use the same code snippet shown above. If you wire XY data (where X is the array of frequencies and Y is the array of phase lags) produced by swept sine to it, the polymorphic VI will automatically adapt. You must input the channel delay for each phase response. If you are asking how one could measure the delay to use for compensation. The delay may be known from a previous measurement, model, or an inline measurement using a VI such as SV Measure Delay VI.
Give it a try, and post your code.
09-14-2016 10:34 AM - edited 09-14-2016 10:39 AM
This is part of the block diagram I have. I got the VI from online and after FRF, the output phase consists of an array of phase and corresponding frequency. I tried adding the delay block but it says it requires a spectrum.
This is inside of the FRF block. I felt like I was supposed to add a delay block here. The swept sine task in has the source setting, stimulus setting and response setting. The output of the frf block is the bode plot of magnitude and the phase. Is there any clue as to how I can implement the delay?
Also, in the initialize block VI, the response and the stimulus data has clusters of 9 elements from 0 to 8. Would you be able to explain why there are 9 elements?
Thank you!
Stephen
09-16-2016 09:32 AM - edited 09-16-2016 09:41 AM
Don't add the delay compensation inside the FRF block as that would modify the SV API VI. If you update to a newer version of Sound and Vibration, it will overwrite your change.
Your first screenshot in the above post looks correct. You are almost there; into SVFA Compensate Phase for Time Delay wire a spectrum info constant input that corresponds to the FRF phase. You can refer to snippet above or screenshot of constant below. Key parameters are the x-axis units and compliementary spectrum units. Set x-axis units to 'Frequency-CB (Hz)' and complimentary spectrum units to 'degrees'.
09-16-2016 11:09 AM
Thank you! One last question though
It seems like the SVFA Compensate Phase for Time Delay block is multiplying the delay by 360 and the frequency and adding it to the phase. This seems to make the phase plot to just increase. The plot below is the phase response of a simple RC low pass filter circuit. Any suggestions as how to fix the angle issue?
Regards,
Stephen
09-16-2016 01:15 PM - edited 09-16-2016 01:28 PM
It looks like you input a delay ~1. That is a lot of delay. First, evaluate the phase response without phase compensation, and then estimate the delay.
delay = Phi_fmax / (fmax * 360)
Then, input that negated delay into the phase compensation VI. One could argue the naming of the VI, but positive delay leads to addition of phase; negative delay leads to subtraction of phase from the input phase spectrum.
09-16-2016 01:26 PM
Here is some data taken with 4461 where the technique mentioned above was used to flatten the phase response.