Phase shift between a pulse and sin wave

Hello,
I was wondering if there is any VI that I can use to get the phase shift between a pulse and a sin wave (they have same frequency).
The Ideal case is that the pulse should go to 1 when sin wave is positive and goes to 0 when the sin wave is negative. I want to set this test to measure the phase shift between pulse going to one and sin wave going positive.
We just bought labview full version with Signal processing package, and I was wondering if there is anything that would be useful for me.
Thanks in advance,
Baran.

Hi Baran,
Try this on for size and see if it works for you.
Have a great day,
Chris V
Applications Engineer
National Instruments
Attachments:
Phase Difference.vi ‏22 KB

Similar Messages

  • Sine pattern and sine wave VI

    i would like to give input arguments to Sine pattern VI and Sine wave VI. Input argument amplitude i would like to give in mm and frequency i would like to give in HZ and periods and i also want to give time as an input. Is it possible? and how? please tell me.
    Regards

    The amplitude input is without units. For example, if you specify 3, then the sine wave values will be from -3 to 3. If you want mm, there must be some kind of conversion. When you say mm, how does this relate to the sine wave? Are you generating a sine wave voltage signal that drives a motor or other actuator that moves a device by a number of mm? Of so what is the relationship between voltage and the mm displacement generated by your actuator?
    Sine Pattern has an input for number of cycles instead of frequency. So you need to figure out how many samples you want in your waveform and how many cycles this should represent. All this depends on the update rate you use for outputing your waveform to the actuator.
    For example, if you want to update your
    output at 1 kHz, choose to have a 100 sample waveform, and want a 20 Hz sine wave -> 100 samples will represent 0.1 seconds of data (at 1 kHz). So 0.1 seconds of a 20 Hz sine signal will include 2 cycles, so you should specify 2 cycles and 100 sample on the Sine Pattern VI inputs.
    The Sine Wave VI frequency input is a bit more complicated as it is a normalized frequency input. Basically, figure out how many cycles you want. Then divide the # of cycles by the number of samples in the waveform you are generating and that is the normalized frequency you should specify. In our previous example, take 2 (# of cycles) and divide by 100 (samples in the waveform we generate). This gives you a normalized frequency of 0.02. This is the input for f (normalized frequency) on Sine Wave VI.
    Christian L
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Where would I find Uniform White Noise.vi, Square Wave.vi, and Sine Wave.vi?

    I am trying to open the Demo Scope.vi that is located in tutorial.llb that comes with the LabView installation. When I try to open Demo Scope.vi,LabView can not find Uniform White Noise.vi, Square Wave.vi, and Sine Wave.vi that are subVIs that Demo Scope.vi is looking?
    Has anyone had similar problems when trying to run Demo Scope.vi through the Getting Started with LabView manual? FYI, I have the LabView Version 6 Base package. Any help on this subject would be greatly appreciated. Thanks in advance.

    This issue also is mentioned in KnowledgeBase 21H8J2R2.
    In LabVIEW 6.1, the Demo Scope VI referenced in the LabVIEW Getting Started manual only uses VIs available in all LabVIEW development systems, including the base package.
    Kelly H
    LabVIEW Documentation
    National Instruments

  • How to change the phase by 90 deg of a sine wave

    Hi
    Does any one know how to change the phase of a sine wave by 90 degrees.
    Mal

    Hi Malkoba,
    Thank you for your post.
    Having looked at your VI I can say that you have created the correct inputs to the 'Sine Waveform.vi'.
    However the dial you had created had no affect as it was not wired into it the 'Sine Waveform.vi' on the block diagram.To fix the problem I have wired the 'Phase' dial into the 'phase' terminal of the waveform generator. This now changes the phase of the sine wave during runtime.
    The dial also now has a digital display (numeric box below it)- this can be used to read the dial's value, or feed in specific values into the control.
    Please find a modified version of your VI below.
    Regards,
    Field Sales Engineer | National Instruments | UK & Ireland
    Attachments:
    NI_phase shift sine.vi ‏31 KB

  • Best fit lines for loops and sine waves

    I am trying to find a best fit line that will work for sine waves and loops (hysteresis loops). I can get the sine wave just fine, but when I switch to a hysteresis it just puts a line across the middle (I assume because of the 2 y values for every x). I am doing data acquisition that will take in both forms and graph them. I tried a polynomial fit and it doesn't work at least the way I implemented it and I tried a few others but it looks like they are all function based. Also, my y values are coming out of a Bessel filter. I don't think this would be affecting anything but I thought I would put it in here incase it does.
    Did I miss one that I haven't tried that works for my application?
    Thanks
    Patrick

    RiversDaddy wrote:
    ... currently I am doing it by looping and reducing the error towards zero to fit the amplitude and phase. (I know the frequency).  If this is what you are looking to do then I will help, or should I be doing things differently? All of the functions I have found to filter or extract tones seem to introduce a larger frequency of phase error than i get using this method, but am I missing something?
    "looping" is a bit vague. What is the actual algorithm to find better estimates (e.g. levenberg marquardt, etc.)
    What problems did you have with extract single tone. Can you show some data where the results from it are not good?
    LabVIEW Champion . Do more with less code and in less time .

  • Color shift between Develop Module and other modules in Lr 5.7.1

    Hello,
    I'm getting a color shift between the devolop module and any other module in Lr.
    It's a recent problem that I've been experiencing since the last update.
    I'm using Lr as part of the Adobe Photographers Bundle in a Windows 8.1 pro.
    Below I have an example for the kind of color shift i'm seeing. The image on the left is from the Devolop Mobule and the one on the right is form the Library Module.
    Is this happening to any one else? Does any one know why?
    I would appreciate any help.

    Gautam is correct in that the preview mechanism isn't the same in Develop and the other modules and, you must view the color in Develop at 1:1 to see an accurate preview. The color space is different that's probably why you see this difference in reds (especially if you use a wide gamut display).
    IF you build your own ICC profiles for your display, be sure the software is not building a V4 (version 4) profile, stick with V2.
    As for exporting and comparing, be sure the secondary application is color managed! Otherwise it's expected that there is a visual disconnect between LR and that app.

  • Type shift between design mode and preview mode in Muse.

    My type shifts / moves positions between design and preview modes. It then justifies differently in differnet Web Browsers. This mean I end up positioning things incorrectly in design mode to accommodate the error when published. I am using the Droid Sans Websafe font from Typekit but it doesn't seem to matter which font is used as the bug still occurs. See the attached images; the left is in Design and the other in Preview. See how the formatting shifts within the software. Also the weight of the headline FORDNESS changes slighlty. On other pages, this headline shifts a few pixels across and down. Any suggestions?

    Hi,
    Text layout and rendering varies from browser-to-browser (and between Muse Design and Preview modes). This may come as a suprise if you have a Print background, but is the reality of the web medium. I'll point you to some previous forum posts that may be instructive.
    Layout shifts because of line-break changes
    http://forums.adobe.com/message/6032336#6032336
    Layout shifts because of font metrics
    http://forums.adobe.com/message/6045303#6045303
    Text rendering differences (general)
    http://forums.adobe.com/message/4778838#4778838
    Text thickening (specific to Safari)
    http://forums.adobe.com/message/5862858#5862858
    Hope this helps.
    Abhishek

  • How to shift between os x and windows in an imac?

    i want to install windows in my imac i know how to do it but once i install windows how do i shift between windows and os x in an imac

    Restart with the Option key held down, or change the setting in the Startup Disk pane of System Preferences or the Startup Disk control panel in Windows.
    (104709)

  • Horizontal shifts between dropdown pages and parents

    I have noticed a horizontal shift when going from a dropdown page bact to a parent page. This seem to happen on all dropdowns. When clicking between parents, no shift. when clicking between children, no shift. Shifting between parents and children only. I'm 99% positive this was caused by the public release. Website is: www.islandguymusic.com , published via FTP upload. There is a version with the same address published to http://islandguymusic.businesscatalyst.com/index.html site via "publish".

    Hi Carl,
    thanks for your answer!
    I also thougt it coud be an issue with the CSS and I've searched the whole CSS-Stylesheet. In the part of the Tab Classes I searched for every margin-top and margin-bottom and set it to 0px but it had no effect.
    Here you can see the part of my CSS-Stylesheet containing the attributes of the tabs:
    /* Tab Classes */
    /* .t4Tabs{text-align:center;padding:10px 0 2px 0;} */
    .t4Tabs{text-align:right;padding:10px 0 2px 0;margin-bottom:0px;margin-top:0px;}
    .t4standardtabcurrent{vertical-align:middle;padding:2px 5px 2px 5px;margin 0px 3px 0px 3px;background-color:#CCCCCC;color:#111111;border:2px solid #111111;border-bottom:0;text-decoration:none;font-weight:bold;}
    .t4standardtab{vertical-align:middle;padding:2px 5px 2px 5px;background-color:#777777;color:#ffffff;margin:0px 3px 0px 3px;border:2px solid #111111;border-bottom:0;text-decoration:none;font-weight:bold;}
    .t4standardtab:hover{background-color:#CCCCCC;color:#000000;text-decoration:none;}
    .t4ChildTabs{text-align:center;background-color:#FFFFFF;padding-bottom:4px;margin-top:0px;margin-bottom:0px;}
    .t4childtabcurrent{margin-left:3px;margin-right:3px;font-weight:bold;background-color:#DDDDDD;padding:2px;border:2px solid #000000;border-top:none;text-decoration:none;}
    .t4childtab{margin-left:3px;margin-right:3px;padding:2px;border:2px solid #000000;border-top:none;text-decoration:none;font-weight:bold;}
    But the strange is that this horizontal space is not equal on every page. On some pages it is quite small and like I want it to be and when I select the tab "Reports" for example there is a huge gap.
    When I change the margin in the CSS-Stylesheet shouldn't it be for all pages? Shouldn't the margin be the same whatever page I am on?
    Greetings,
    Sofie

  • Generate complement​ary digital signals with dead time between each pulse and controlled by duty ratio

    I am to generate  two complementary digital signals using NI 9606 conected by RIO Mezannine Card to NI 9683 (Half Bridge DO).
    I am able to generate the signals but I am not able to put dead time between high and low signal and also, low and high signal.
    Requirement:
    (1) When the first signal goes high and the second signal goes low, there should be a controllable dead time.
    (2) Also when the second signal goes high and the first signal goes low, there should be a controllable dead time.
    I am able to do requirement 1, but I am unable to fulfill requirement 2.
    Please have a look at my VI and let me know how to go about satisfying requirement 2.
    Attachments:
    complementary test 2.vi ‏69 KB

    Hi Frank ,
    I have already taken note of the example Tannerite has provided  and have built my vi ( attached in previous post) surrounding that example.
    Now I require to control the PWM duty cycle as you can see from the vi using a knob and that control refers to both the signal 1 and 2.
    Now the signal 1 end and signal 2 generation requires a controllable dead time. Similarly, signal 2 end and signal 1 geneeration also requires another controllable dead time.
    I am able to do either one dead time at a time using delay but not two dead time simultaneously.
    I feel that I have two put the delays at the appropriate data flow point. I am working on that.
    I would really appreciate if you could give some insight on how to solve this dead time issue and generate two complementary waveform with dead times whose duty cycle can be controlled by a knob controller in fronty panel .
    I have also posted the required timing diagram for reference as suggested by Tannerite.
    Best regards.

  • Labview code for generation of pulses like radar pulses inputting sine waves

    dear sir,
    kindly send me labview block diagram as simple as possible who could convert

    This is a duplicate post. Please refer to this link for further
    information.
    In order to maintain the
    forums in an orderly manner and to keep problem solutions and information in a
    consolidated fashion easily searchable by customers, duplicate posts are often
    linked. Best of luck in future applications.
    Jared T.

  • Measure phase shift

    Hi!
    I have got a question relating the measurement of the phase-shift between an in- and outgoing voltage (both analog and the same frequency) of my DAQ-Device.
    I can´t find a VI to detect or measure the phase-shift and I don´t know how to solve this problem. So somebody can help me? Somenone can tell me if there´s a VI in the /examples folder or can send me a self-made VI? Or someone just can tell me how to begin...???
    Thanks!
    [email protected]

    Mario,
    This is a difficult thing to do accurately in software. Since the two signals may be different amplitudes, you need to measure the time difference between the zero crossings.  Sample the two signals at a high rate using a simultaneous sample and hold A/D card, then measure (calculate) the time difference between each signal's zero reading (i.e. the zero crossing).
    Hope this helps,
    John

  • Phase shift of a sine wave and a square wave

    Hi,
    I would like to simply compute the phase shift between a sinusoidal waveform and a square one. Between two sin-s I can compute, but I have no idea how to do that with a square waveform.
    Thanks,
    Ussr123

    Hi there,
    the easiest way is to use the ExpressVIs.
    But you are only allowed to use the ExpressVI "Tone Measurements" if you have enough periods of the square wave, because it computes the phase with FFT.
    An other possibility is to use the spectrum analyser VI as used in the attached exsample.
    Greetz
    Branni
    Attachments:
    Phaseshift_Sqr_Sin.vi ‏89 KB

  • Measuring lag between input and output sine waves...

    Hi,
    I am using a Labview VI to control an array of servo motors, each receiving a sine wave input (with different phase offsets for each servo). I'm using a NI USB-6229 DAQ system to monitor their movement via a wire that I've soldered onto each servo's potentiometer. I've written another VI that recieves both the initial sent signal and the returned DAQ signal and plots both on a waveform chart. Both signals show up on the plot as expected, with an obvious phase shift between them. I'm having problems accurately measuring the phase shift, and I'd rather have an automatic method that gives accurate numerical values instead of a more qualitative visual method.
    So far I've tried to use triggers and peak to peak comparisons, but I've been having problems getting results in real time. My incoming signals are time stamped, if that helps. Is there a quick and easy method to extract phase shift data from two sine waves on a waveform chart?
    Thanks for the help...

    Since I work with lock-in amplifiers I came up with this. I guess it will work in your case. This method has some limitations. It will work up to 180 degree. It also measure absolute phase lag. You can not say if the signal is leading or lagging. But in your case it will always be lagging. I posted a VI showing the method in another discussion. Here is the link. http://forums.ni.com/ni/attachments/ni/170/409516/1/demo_v2.vi. Since your DAQ unit do not have simultaneous sampling you will get a small phase error due to inter-channel delay. This is also true if you use the FFT method. What is your signal frequency and which samplerate do you use?
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Shift between sound and image ?

    Hi there!
    I have a weird issue on my computer: there is a tiny shift between the sound and the image: the image goes faster than the sound, which is very annoying, especially when the movies are long. Sometimes it works perfectly and it seems to be because the computer is busy doing something else in the background. Otherwise when I'm just running quicktime, the shift appears... But I am not sure this is because of that actually. Any idea ? Thank you a lot !

    Any idea?
    Afraid I don't fully understand your question. If you are asking why this occurs, the reasons most frequently are:
    1) Camcorder audio recorded at 12 bits is converted/captured by harware/software that expects audio to be in a 16-bit format. In this case audio data is processed in groups of 16-bits where only 12 represent a discrete unit of coded sound.
    or
    2) "Muxed" source file using custom/non-standard bit rates and/or VBR audio is converted to a "frame-to-frame" sync format file. In this case, audio and video is "demuxed" to individual intermediate audio and video streams before final conversion to the target format. Once again, the intermediate audio usually expects a fixed/constant number of bits to represent a discrete unit of coded sound.
    Basically, what's happening is that the audio and video streams of information are no longer of the same length when laid out side by side (i.e., "frame-to-frame) and, thus, the audio and video are "out of sync." Specifics may vary. It all depends on the actual source formats, as well as, the manner in which the final streams are merged. Most frequently, the audio track ends up shorter than the video track. If they are merged by starting both tracks at the same time ("added"), then the audio gradually diverges from the video more and more throughout the movie and by the end of a long clip can be noticeable "out of sync." If the tracks are merged by "adding and scaling" one of the tracks, then the problem is somewhat more difficult to define. In this case, the beginning and end of the movie may be nticeable "out of sync" while the middle may almost seem to be "in sync."
    Now, if you are asking about solutions, then those depend on the source of the problem. Where the problem is merely in the camcorder setting, change it. If it is in the conversion/capture by hardware/software and user settings are available, then change them. If no such user settings are available, consider changing your work flow. (E.g., capture/convert using different hardware, software, or methodology such as digital-analog-digital double conversion where all else fails). Lastly, you could attemtp to "fix" the problem in "post-production." While is should be a last resort, many good editor applications do allow you to analyze the audio graphically and scale (compress/expand) tracks in order to "re-sync" them. While I have yet to try the utility myself, a dedicated application called "Movie Sync v1.0" is currently available for Mac machines. This utility allows the user to loop audio at a desired point in order to "locally" re-sync audio and video. (I can only assume a localized "scaling" is being performed.)
    Does that help?

Maybe you are looking for

  • Trouble connecting wirelessly via Verizon FiOS router

    I am using a Titanium G4 Powerbook, OS 10.4.11. I have an Airport Extreme connected to a Verizon FiOS router. These are set to broadcast on different channels. Our iMac is connected to the FiOS via Ethernet: no problem getting online. Other Mac noteb

  • Help me PLEASE!!!! "MAC KEEPER" DONT DOWNLOAD!!!!

    I have recently installed Mac Keeper dobviously on my Imac before reading the reviews.  I then decided to uninstall it but now my Facebook and Ebay accounts are totally currupt. DOES ANYONE KNOW IF I CAN BACK DATE THE SYSTEM TO BEFORE I INSTALLED IT?

  • OS9 bootable G4 mac fails to boot with NI-DAQ4.9

    We're going to use the OS9 bootable G4 machine with NI-DAQ4.9 driver. However, after the installation of NI-DAQ4.9 the G4 machine failed to boot up(Pure OS9 boot. Not classical environment). The error message said that address error occurred when the

  • Problems with missing template handler

    Hello, We have put the name testmiss.cfm in the missing template handler in the administrator. Still, the default ColdFusion error message shows when a cfinclude has template=a nonexisting file and when in an html form, action=a nonexisting cfm file.

  • UC540 FXS port "CCA Hangs"

    Dear all, The port needs to be a user phone I need to be able to set it up in a hunt group etc When I go to users and extensions / users and phones the operation in progress sits there endlessly with operation in progress. The end result I need is an