05-30-2024 05:33 PM
Hello all,
I have two signals coming into NI 7841R through AI0 and AI1 and out through AO2 and AO3. These signals are visualized on a standalone oscilloscope through AO2 and AO3. I want to phase shift the 2nd signal from the front panel and should be able to visualize 2 signals separated by the phase inputted into the phase control. Also, the 2nd signal has a higher frequency so I want to a single instance of it during the positive half cycle.
I don't know how to get these and will need the assistance of the LabVIEW community.
So far, my code can detect the rising phase of the 1st signal which is a sine wave however I am unable to get the phase shift and also unable to output just 1 square wave instead of 3 as shown in the attached file.
Please help.
05-31-2024 11:55 AM
Any help on this yet?
I would appreciate your assistance.
Thank you.
06-03-2024 10:33 PM
Am I doing something wrong in the community?
I keep seeing the number of views going up but no help.
I have tried to solve the issue with the use of shift registers but to no success.
I will appreciate any help given.
Thank you.
06-04-2024 12:54 AM
Hi Lawrence,
@lquarshie wrote:
I don't know how to get these and will need the assistance of the LabVIEW community.
You should know how to get the required data: atleast you should know the math behind…
@lquarshie wrote:
So far, my code can detect the rising phase of the 1st signal which is a sine wave however I am unable to get the phase shift and also unable to output just 1 square wave instead of 3 as shown in the attached file.
Your code does not detect the "rising phase" of the sine wave, it detects "positive values": quite a difference! (As written before: you should know the math behind your algorithm!)
To determine "phase shift" of two signals you need to determine their "zero crossing" (or a similar detectable) event and compare the timestamp of those events with respect to the wave period: again I suggest to "know the math behind the algorithm"!
Right now your test VI contains just a bunch of ExpressVIs and some very questionable constructs using DDT wires: I recommend to stay away from ExpressVIs and DDT wires as long as you don't know LabVIEW very good. DDT wires hide too many information!
06-04-2024 01:39 AM - edited 06-04-2024 01:48 AM
Phase shift for two different frequencies is never constant 😉
If you have more that one frequency in your signal (incl. harmonics) the zero crossing detection doens't have to be a measure for the phase of (the base?) a frequency.
extract tone vi would be a better way IMHO
06-04-2024 11:37 AM
Thank you very much for your response.
I tried using the math functions to implement the phase shift between the signals but realized not all LabVIEW functions work on the FPGA.
I have been going through several materials to understand all the necessary algorithms to get the desired outcome.
I appreciate you making time to respond to my question.
06-05-2024 07:07 PM
So I know I can do a phase shift with first of all knowing the frequency of the sine wave and then multiplying the phase (angle) / 360 and that's gonna give me the time difference. However, I am unable to do this because there division block is not supported on the FPGA.
Can you help with the best way to implement this? What are the blocks that will be required?
Thank you,
06-06-2024 12:43 AM
Hi l,
@lquarshie wrote:
multiplying the phase (angle) / 360 and that's gonna give me the time difference.
However, I am unable to do this because there division block is not supported on the FPGA.
Division is supported on FPGA, but takes a lot of resources.
Did you know that division by x is the same as multiplying by the inverse of X? (Basic math…)
06-06-2024 07:49 PM
Thank you very much. I have been able to implement the division operator using the inverse of the number.
However, I am still struggling with implementing a phase shift between the two waves. I have tried several examples from the community using shift registers but not working.
Currently, I am working on generating a sequence of two waveforms with time delay and feeding it into the analog output AO but it also isn't working.
Still need help to figure out this.
Thank you!!!
06-07-2024 08:50 AM
Hello sorry for asking so many questions and it's because I am new to FPGA and LabVIEW.
I found a book I believe will be helpful called "Digital Signal Processing Laboratory: LabVIEW-Based FPGA Implementation".
I have placed an order for this book but the delivery is next week Friday.
Is anyone here having a soft copy of the book that they are willing to share?
I will appreciate that.
I want to be good with LabVIEW so I don't have to ask the community all these questions.
Thank you!!