02-06-2008 03:54 PM
02-06-2008 05:21 PM
02-07-2008 03:06 PM
02-07-2008 05:02 PM
02-08-2008 02:45 PM
yes, I need to know the peak and what is the phase at that point.
I am be able to get every peak of sine wave, but phase has positive and negative.
What I need is, for a continuous sine wave, the phase is increasing, like 0, pi/2, pi, 3pi/2, 2pi.....etc..
for example, at time t1, what is the peak and phase, t2, the peak and phase.
thank you
02-08-2008 03:04 PM
02-11-2008 02:36 PM
Mostly like the phase is being reported from 0 to 180 or 0 to -180. There is a VI to unwrap the phase.
I took a look at your code and I am a bit confused about what you are trying to do. Right now it looks like you are gathering 100k samples at a sampling frequency of 200k in a finite acquisition.
In your code, each iteration of the For loop takes 100k samples and finds the number of peaks. The Extract Single Tone Information.vi finds the tone with the largest amplitude in the 100k samples and returns the amplitude and phase. The phase in this case returns the absolute (start) phase of your detected sine tone, that can also be viewed as the phase relative the beginning of your signal (in this case the beginning of the 100k samples).
On the next iteration, the code takes a new set of 100k samples and calculates the same information (again the phase is based on the start of this new set of 100k samples).
What is your ultimate goal? To continuously acquire data, find peaks and their phase relative to the first sample collected? To acquire a finite set of data, and find the phase of each peak relative to the first sample? Get the relative phase between two different peaks? What are you using the phase information for? Are you using the phase to count the number of cycles? What kind of signal is coming from your signal generator?
To compare the phase to the first sample you will need to use some comparison vi’s as mentioned in another post. Shift registers can be used to keep a “running” total of the phase from the first sample.
02-11-2008 03:12 PM - edited 02-11-2008 03:17 PM
I am doing a Fabry-Perot sensor project. Before that I need to do some stimulations by using sine wave (analog signal) generated from function generator on NI ELVIS.
I need to be able to know the peaks of sine wave and the phase of each peak.
For FP sensor, if I know the phase changes, I will know the displacement of gap increase or decrease.
For sine wave, If I know one peak and its relative phase compare to another peak and its phase, I will know the phase changes between two peaks.
I hope I expleained it right.
thank you for your helping.
02-12-2008 11:48 AM
Hi ChienH,
I did some more looking and a found an example program that was used by a user trying to read in data taken from a fabry perot cavity. Like you he wanted to find the distance between two consecutive peaks.
The example program attached has three files (inside the zip file): peak in.txt, peaks out.txt, Advanced Peak Detector (Amplitude and Position).vi.
The VI reads in pre-recorded data from peaks in.txt then
finds the amplitude and distance between each peak and saves the data in peaks
out.txt. There is Boolean control on the
front panel to specify how many channels to turn on for processing. The example was written for 6 channels, but
can be easily modified to include more. The block diagram of the VI has some good explanations about the important parameters for the processing.
You should be able to take the code in this example and modify it for your needs.
Hope this helps.
02-13-2008 01:20 AM