Looking for the best way to perform a Transfer Function to get Phase Shift
and Gain on a slow sine wave (0.5 and 2.0 Hz).
I have a reference signal and six feedback signals to look at. Using an old
DAQCard-700. Even though it's not capable of syncronous acquisition, I'm
sure the acquistion (scan) rate is fast enough for such a slow signal that
it should be OK.
First, what is the best way to even acquire the waveforms. I have tried a
couple different ways and both seem to work OK.
One is using the AI Acquire Waveforms.vi and then sending the results
through an Index Array to break out each waveform. On this one I also send
it through a Butterworth Filter (8 Hz Low Pass) to clean up noise and this
would be a similar filter to what was being used on our chart recorder. I
capture about 3 cycles of the waveform and then use an Array Subset to look
at just the last 2 cycles. The Butterworth gives some distortions to the
beginning of the waveform and looking at the last 2 cycles is a bit of a
work-around. This is then sent to the Transfer Function.vi along with the
reference signal.. The waveforms prior to this point seem to be clean and
normal. The outputs of this vi is mostly garbage. The Gain jumps all over
the place, occassionally hitting on what it should be. The Phase doesn't
seem to do anything at all. I have also tried using the AC & DC
Estimator.vi to subtract out any DC offset before sending the waveforms to
the Transfer Function.
The other method I used was to start with one of the example programs to get
a software trigger and then using basically the same Array and Filter
functions as above to extract out a single cycle. Then using the Array Max
& Min function I can determine amplitude (and eventually gain) from the
Max/Min values. Phase can be indirectly determined from the Max/Min
indices.
What is the best way to break out waveforms from a scan acquisition?
What is the best way to get a clean / filtered waveform?
What do I need to do differently to get the Transfer Function.vi to work?
Due to these being such slow signals, it's not practical to capture more
than a couple cycles of the waveform.