phase measurement changing amplitude

This is a discussion on phase measurement changing amplitude within the labview forums in Programming Languages category; Hello, Attached vi generates a data stream with increasing amplitude. I am trying to find its amplitude using tone measurements.vi, spectral measurements, extract single tone, and phase spectrum.vi. I do not understand why I cannot get 0 phase and why these VIs give different answers.   Next I am trying to match this data stream by generating another signal using the phase,frequency and amplitude information obtained from the generated signal.   In real world, I have a data with changing amplitude and I am trying to generate another wave (sine wave, by using generate wave.vi) to match it so that I ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-06-2008, 12:40 AM
ilteris
Guest
 
Default phase measurement changing amplitude

Hello,
Attached vi generates a data stream with increasing amplitude. I am trying to find its amplitude using tone measurements.vi, spectral measurements, extract single tone, and phase spectrum.vi. I do not understand why I cannot get 0 phase and why these VIs give different answers.
 
Next I am trying to match this data stream by generating another signal using the phase,frequency and amplitude information obtained from the generated signal.
 
In real world, I have a data with changing amplitude and I am trying to generate another wave (sine wave, by using generate wave.vi) to match it so that I can find approximate phase values corresponding to each point in the real data. My questions:
 
1. Why is not there a vi showing 0 phase?
 
2. Is there a way to match the increasing amplitude data, maybe by using another parameter(rate of change of amplitude) in generate sine wave?
 
3. Or is there an other way of tagging phase angle values to the real data?
 
Thank you very much for your time.


Tone2.vi:
http://forums.ni.com/attachments/ni/...205/1/Tone2.vi
Reply With Quote
  #2  
Old 01-07-2008, 03:40 PM
ilter
Guest
 
Default Re: phase measurement changing amplitude

Hello Lynn,
 
Thank you for replying.
 
I am attaching the real data this time. First column is the trigger signal, and the second is the data. Trigger signal is where the value is aroud 3.5 (It is repeating around 30 times but the first one is the real trigger). 
 
My signal starts from 0 , but since I am only using the points(501) around the pulse amplitude is not zero. Frequency of the signal is  90 hz and it is changing about 10 hz, amplitude is also changing from time to time. These pulses are representing recording of images. I am grouping pulses (images) according to tagged phase angles. Each group is composed of 10 degree interval.
 
I am not sure how much lag is ok, but it is ok if they still fall in the same interval.
 
Thank you once more.


data.TXT:
http://forums.ni.com/attachments/ni/...421/1/data.TXT
Reply With Quote
  #3  
Old 01-07-2008, 05:40 PM
johnsold
Guest
 
Default Re: phase measurement changing amplitude

I am not sure I understand correctly, but here is something I tried. I saved your data to a control. I find the trigger by looking for the first data point with value greater than a threshold. I extract a subset of the data around the trigger (501 points starting 250 points before the trigger). I find all the rising zero crossings in that subset, convert the time data to frequency and generate a sinewave with the same average frequency and the amplitude equal to the maximum value in the subset and the same number of samples. (Number of cycles = frequency * sample period * number of samples). I find the phase difference by subtracting the first rising zero crossing in the data subset and the generated waveform. Then I extract a new subset of the original data shifted by the phase difference and plot the result in Waveform graph 2.Building arrays inside loops is not good practice if you have large amounts of data. Initialize the array outside the loop and use Replace Array Subset and a shift register to avoid reallocating memory. For this small demo the performance hit is insignificant. The program is not optimized, but is intended to generate some alternative ideas.Lynn


Tone2.2.vi:
http://forums.ni.com/attachments/ni/...8/1/Tone2.2.vi
Reply With Quote
  #4  
Old 01-08-2008, 03:10 PM
ilter
Guest
 
Default Re: phase measurement changing amplitude

Dear Lynn,
 
Thank you very much for your effort. Your VI definetely helped me to think different alternatives. I know you already spent a lot of time for me but I need the phase angle values at the trigger points.
 I tried implementing this in your vi by using tone measurements vi to get the phase values of the generated sine vi and later the correspponding trigger point, but it  still gave me a nonzero phase for the sine wave. Also no problem but I think it runs for one time only.
I am attaching a VI, I was working on. I know it is a very low performance and primitive VI, but any recommendation is welcome. My vi reads the pulse, and data then adds time and index information. Later when it detyects a trigger point it extracts 501 points like your vi. Then gets frequency, amplitude, phase values from tone measurements vi (where I got the error). Then using these values generates a sine wave and writes phase values for this wave. Last step is to save the phase values at the pulses. This vi repeats for all the pulses.
If you can tell me how to calculate phase values for each point I will really appreciate that.
 
Thank you once more.
 
Regards,
 
ilter


Phase_measurement.vi:
http://forums.ni.com/attachments/ni/...measurement.vi
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:58 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.