FFT phase shift

I am using LabView7.1 and am trying to understand how the FFT measures the phase difference between 2 analog input signals.  The 2 signals have about the same amplitude and their phases will be about the same. I am getting a phase difference of exactly 0.000000 but there should still be a difference. Not sure how the FFT block compares the two signals. Do I need to specify which is the reference signal? If so, how do I go about doing that?
Thanks,
SparkEE
Attachments:
BTB Acceleromter.vi ‏378 KB

I admit this is not 100% on mark but may give you some ideas. In this thread I suggested using a zero-phase shift filter. Ignore this post if it does not help.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • How do I apply a uniform phase shift to a waveform?

    In LabVIEW 6.0, I am attempting to apply a uniform phase shift to a non-periodic waveform but have run into a problem. Theoretically, if I take the Fourier transform of the signal, apply an offset to the phase and then take the inverse transform of that, the output of this process should be my original waveform with all of its frequency components delayed by the same number of radians (different amounts of time). However, I am not getting this result from LabVIEW. In the attached example code I generate a sine wave burst, take the FFT, convert from cartesian to polar, apply an offset to the phase, convert back to cartesian and take the inverse FFT. However, instead of getting a phase-shifted, same-amplitude versio
    n of the input at the output, I get an amplitude shifted, same-phase signal. What am I doing wrong?
    Attachments:
    phase-shift.vi ‏51 KB

    This only works (partially) if your array size is an integral power of 2 (e.g. 512, 1024, etc.), i.e. in cases where the fast fourier transform can be used.
    You need to use the complex FFT (and the hilbert transform)
    Please see my example posted HERE
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • How to measure the phase shift using AC analysis?

    Hi,
    I have a simple RLC circuit consisting of no more than 4 components. If i hook up the network analyser function to the circuit and read the S11 values, i can see a change in the input impedance and a phase shift when i run it across a range of frequencies.
    I am trying to do the same with the AC analysis tool. I've placed a probe on the positive input line. Using the AC analysis i've obtained the input impedance by using the expression mag(V(Probe1))/mag(I(Probe1)). Everything looks fine but i just can't seem to obtain the correct expression to gain the phase shift. All of the values i get out seem to flat line.
    It would be great help if someone could point me in the right direction, as i'm running out of ideas.
    Thanks for the help.
    Attachments:
    M1.png ‏3155 KB
    m2.png ‏618 KB

    Hi 08Ultrasound,
    You need to measure the voltage phase difference over a load as the voltage source is ideal so will always be in phase.
    Regards,
    Adam Brown
    Applications Engineer
    National Instruments UK

  • Calculation of phase shift

    Hi all,
     I am continuously acquiring two sinusoidal signals from the analog inputs of a daq card and saving the samples of the two signals into two different float type arrays. Can anyone tell me that how to calculate the phase shift between these two signals and as well as the peak voltage of the two signals? Please expain me with the help of an example code.
    Thanks

    Hi AI S
    I have gone through the example of phase diff e.g and i have written the following code but when i run it , it gives the max value of 1st sine wave (outarray1) nearly equal (i-e 7.7 volt ) but it should be 8 V pk.
    But for the 2nd sinewave (outarray2) it gives the max value from 0 volt to 1.5 volt pk but it should give 1.5 Volt pk only and the phase difference is displayed as 0.000 , even there is no update in decimals in it.
    One more thing to tell that 1 complete sine wave consists of 1024 samples , therefore in outarray1 and outarray2 , there are 8 cycles each. In one iteration of the loop outarray1 is filled and in other iteration outarray2 is filled , then i calculate the phase shift.  Please tell me what i am doing wrong.
    Here is my code
    double outarray1[8192],outarray2[8192] ;
    double *peakLoc, *peakAmp, *peakDeriv;
        int count;
    static double wave1maxval = 0.0;
    static int wave1maxind = 0;
    static double wave2maxval = 0.0;
    static int wave2maxind = 0;
    static double phasediff;
    PeakDetector (outarray1,8192,0.0, 3, 0, 1, 1, &count, &peakLoc, &peakAmp, &peakDeriv);
        if (count>0)
            wave1maxind = peakLoc[0];
            wave1maxval = peakAmp[0];
     SetCtrlVal(panelHandle,PANEL_wave1maxind, wave1maxind);
     SetCtrlVal(panelHandle,PANEL_wave1maxval, wave1maxval);   
        if (peakLoc)
            FreeAnalysisMem (peakLoc);
        if (peakAmp)
            FreeAnalysisMem (peakAmp);
        if (peakDeriv)
            FreeAnalysisMem (peakDeriv);
        PeakDetector ( outarray2,8192,0.0, 3, 0, 1, 1, &count, &peakLoc, &peakAmp, &peakDeriv);
        if (count>0)
            wave2maxind = peakLoc[0];
            wave2maxval = peakAmp[0];
      SetCtrlVal(panelHandle,PANEL_wave2maxind, wave2maxind);
         SetCtrlVal(panelHandle,PANEL_wave2maxval, wave2maxval);
        if (peakLoc)
            FreeAnalysisMem (peakLoc);
        if (peakAmp)
            FreeAnalysisMem (peakAmp);
        if (peakDeriv)
            FreeAnalysisMem (peakDeriv);
        phasediff = (8/8192) * (wave1maxind - wave2maxind) * 360;
        phasediff = fmod (phasediff, 360);
       SetCtrlVal(panelHandle,PANEL_Phase_Diff,phasediff);

  • How can I create a phase shift that will cause cross-cancellation?

    I recently recorded something using a USB audio input, and after it was done realized that a cellular device had interfered with the signal and I have a terrible hiss, some clicks, cell noise, etc. in the recording. Setting a noise print and running "Reduce Noise" did more to help this file than I ever would have thought possible (thank you Apple!!), but I think I might be able to do even better.
    The left channel has the audio I need, plus all the noise. The right channel has ONLY THE NOISE! Can anyone think of a way that I can use this right channel to create a cross-cancellation of the noise in the left channel? Theoretically, this should create a perfect (or close enough to it for me) file, should it not?
    The phase shifter doesn't seem to have what I would need to do this, but I'm sure some audio genius out there can think of a way I can either do this manually or with a filter or effect.
    Thanks for any suggestions!

    Hi Glen,
    IF you were to take two +identical signals+, sum them in equal amounts and flip the phase on one of them 180º to the other you will get +complete cancellation+.
    According to the manual on page 221 the Process>Invert will do this.
    Invert
    +Choosing this command inverts the phase of each sample in the audio file or selection.+
    +Each sample’s amplitude is unchanged, but the phase is inverted. In the waveform+
    +display, the wave’s crests become troughs and vice versa.+
    IF your R channel is the exact same noise as the noise in your L Channel then this technique could work for you.
    You can test this out with any track -> put a copy of it on another track and Invert, they resulting playback will be total silence.

  • Phase shift, frequency of 2 analog signals, Diadem 9.0 or 9.1

    I have to acquire 2 signals: FORCE (N) and VELOCITY (m/s) for many frequencies parameter in Diadem 9.0 (5 to 150 Hz). This frequency parameter is a analog voltage output signal which is converted in frequency by a frequency vibrator instrument. The measured signals on the vibrator (force and velocity) are considered as SINE Functions. – 1) How do I measure the output frequency of the two signals and how can I save this data ? – 2) How can I estimate the phase shift between FORCE and VELOCITY ? – 3) How can I automate the estimation of the phase shift by the 145 measurement (150-5Hz) ? – 4) Is a continue measurement of Phase Shift depending on the frequency possible ? – Best Regards from Germany and from France.
    Jean-Pierre, Junior Engineer Germany

    Hello KenT. I have test your DIAdem exemple. Your idea with a stop-time was not bad for measuring the phase shift beetween 2 generators by 1Hz. I have used this formula by many phase shift and it works. I had change the 2 generators frequency by 2Hz, and the formula works not anymore and that is normaly because of the reduce of the periode lenght (this problem have I show on Picture 3 of the PDF Data). On the picture 6 and 7 have I try to make another solution. My new solution works only for frequency from 1Hz to 5Hz. What about frequency like 150Hz ? I don't know if you have understood what I realy want to do, but if you have any idea to resolve my problems, please write to me. '[email protected]'
    Jean-Pierre, Junior Engineer Germany
    Attachments:
    DIAdemTexte.pdf ‏435 KB

  • Can 7 phase shifted 1kHz digital squarewaves be output using E-series DAQ?

    Is it remotely possible, using a PCI-5052E board, to generate seven different 1kHz squarewave digital outputs that are phase shifted (0 to 180 degrees) relative to the first output.

    Unfortunately, I wouldn't consider this very likely at all. While there is 8 DIO lines on this boards, you only have immediate software update control over them. (No strobed, hardware-timed output.) So you'd need a program that constantly toggled the state of these lines which would not be very fast or deterministic for that matter.
    A PCI-6602 counter-timer board would be a more likely solution and costs much less than a 6052E. However, you'd have to trigger each output at the right time in order to get the phase shift. The most flexible solution would probably be a PCI-DIO-32HS.
    -Russell

  • Add phase shift to a sine wave

    Hi,
    Can I add a varying phase shift (through a control from front panel) to a sine wave?
    Thanks,
    Sharmi

    Similar to this? That event should be a dial value change but the snippet messed it up
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    shift.png ‏27 KB

  • Rajouter le nombre d'implulsion sur l'exemple "Multiple Counters with Phase Shifts.llb"fournit par NI

    Bonjour,
    J'utilise une carte PCI6601 NI DAQ traditionnel avec LV6 et je génère 4 signaux à l'aide de "Multiple Counters with Phase Shifts.llb"fournit par NI. Cela marche très bien néanmoins je voudrais pouvoir rajouter le nombre d'impulsion. Ce nombre serait le même pour les 4 signaux.
    Merci d'avance

    Monsieur,
    Dans cet exemple vous ne pouvez fixer le nombre d'impulsion puisque c'est une generation d'impulsion en continue. Vous devez donc modifier cet exemple afin que le compteur 0 ne genere pas en continue notamment en prenant comme exemple le VI finite pulse train qui utilise un compteur comme gating du compteur qui genere.
    France.support

  • Record sound with mic, phase shift 180 degrees, then play?

    I'm looking to record something with a microphone, phase shift it (up to 180 degrees), then play it into a speaker.
    Is there a way to do this in Labview?
    I have various DAQ boards (NI 9233) and a microphone, the Sound and Vibration suite, and a PC with speakers.
    Solved!
    Go to Solution.

     In LabVIEW>>Help>>Find Examples... search "sound", there are some examples.
    Attachments:
    wav recorder.JPG ‏137 KB
    sound player.JPG ‏120 KB

  • Final Cut Pro 7 Phase Shift of Field shift

    Good Afternoon....
    I am editing video shot on a DSLR and between every cut there is a freeze frame....
    I can't tell if it is a phase shift or field shift.
    Does anyone know how to fix this problem or a pay phone support
    service in Palm Beach Area?
    -Mat

    Select the sequence in the FCP Browser, then go to the menu File > Media Manager and use the Media Manager to Recompress your material.
    Choose recompress, then choose the correct flavor of ProRes for your Frame size and Frame Rate.
    Note that the resultant files will be considerably larger than the original. This is normal and correct as the highly compressed files are "unpacked" for editing use.
    MtD

  • What you hear recording sounds like Phase Shifter!

    Hi, when I record with "What you hear (from youtube, etc.) it sounds like it came through a phase shifter: real bad. I have a dell xps 420 with Vista 32 bit and it'scame bundled with?creator premiere, adobe soundbooth, etc. Intel core tm2 quad cpu, 2.66 Ghz, memory 4GB
    it seems to record ok with line in and mic. Can someone please help?

    Actually, there's discussion about this all over the Internet.
    The problem is your move to Vista and Windows 7
    Under pressure from the record companies, the ability to record the Stereo Mix output of you computer has been disabled or removed from many new computers.
    You may be lucky and find it's only been disabled on your machine.  If so, then do the following:
    To enable:
    ->> go to Control Panel
    ->> Hardware and Sound
    ->> Manage Audio devices
    ->> in the Recording tab window right click in the white area away from any devices and from the menu enable "Show Disabled Devices" and "Show disconnected devices"
    ->> right click on Stereo Mix to get the properties window and in Device usage "Use this device (enable)"
    However, there have been many reports in here (you can do a search) that some computer manufacturers are actually removing this ability entirely, again under pressure from the record companies.
    This being the case, you might try some software called Virtual Audio Cable: http://software.muzychenko.net/eng/vac.htm
    You have to pay for it but at least there's a trial version so you can see if it works for you before laying out your money.
    Bob

  • Phase shift base signal

    Hello,
    I have two sinusoids which have a phase difference which varies slowly over time,  the difference being indicative of position. To measure the phase difference, i have used a premade vi called "Graph and Calcuate Phase differece". I have also used an example online to somewhat sucessfully calculate the phase some of the time.  The example would be the code that was posted in this thread.
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=6956&query.id=101197
    These examples work great with theoritcal signals, but there is a problem (see figure below) I am having in practice..  Since the phase shift can occur in the range [-360,+360], i believe the index of the peaks are getting lost, causing it to pick up the next peak in the sequence, thus, causing a phase shift (see figure below, plot of phase shift) to be measured.  Another way of saying this is that after a small amount of phase shifting occurs, the lead peak begins to references the next peak in the comparison signal.
     Im at  loss on how to identify the peaks and track them so i can accurately measure phase shift.  Any help is appreciated. Im sure this is soemthing that has been done before, esp since there is a vi just for measuring phase shift. I guess i just dont know the key words to find it...
    Below is a screen shot showing the two signals. The bottom plot is showing there is a relative small shift in phase which periodically jumps.
    many thanks
    Jim from CT
    Message Edited by JimmyinCT2 on 01-23-2008 07:17 PM

    dahhh, okay, i think i finally figured out what is going on here, and i think im just being somewhat dumb or maybe just assuming to much.
    Looking at matts example helped a lot as i see why.
    with one of the old VIs for measuring phase shift, we were getting a phase shift range of [-360, 360] or more.    We were just assuming that was the range here with this new VI. 
    With the new dual channel measurement (or the example you posted), when phase is measured, there is an inflection point at some angle of phase difference..  The way your example works (and the express vi) is with an inflection at 180 degrees.  So, lets imagine we have a measurement of phase shift that is 178 degrees, as this difference increases, the next is 179,  and then 180..  Now as it continues to move, the next phase measurement will not bet 181 but instead -179.   As the signal continues to move in the same direction, its then 178, 177, 176.. So there is an inflection point at 180 degrees with two sinusoids, in simple terms, its because the phase difference of one sinusoid to the other has shifted and is now being measured in reference to the next peak in the series.
    Its troubling for measurements are if you turn on a machine that is measuring phase, and it happens to be right near -/+180, it can cross that boundary often, creating substantial noise.   Also, that for certain types of peak detection, such as for motion, its desirable to have a larger range such as [-360,360] which should be theoretically possible (like the first vi we used)  but i guess [-720, 720] could be done too assuming there is enough difference between the peaks.  It would have been awesome to have a VI that measures peak movement outward to infinity.   We were originally using a VI that calculated out these larger differences, think it was doing the calcs in frequency domain (imaginary nums) rather then cross correlation like the example.
     I think for now, we are going to have to work inside the range [-180,180] and initialize our hardware to 0 phase so we dont start near the inflection point and see if that works.
    Message Edited by jimmyinCT on 01-26-2008 07:54 PM

  • Distance measurement using Ultrasonic sensors and phase shift method

    Hi, 
    I've recently started a project where the idea is that we have an ultrasonic transmitter and a receiver. The transmitter will send out a signal at 40 kHz that will hit some object, most likely a book, and reflect that signal to the receiver. The received signal should have a phase difference from the outgoing signal. Now, when we vary the outgoing signal, the phase shift should also change. Likewise, if we vary the distance to the object, the number of wavelengths that can fit in between the object and the transducers should also change. We would multiply the incoming and outgoing signals and measure the beat signal, but I'm not sure how we would do this in labVIEW. We can calculate the distance to the object by figuring out what d(phase)/d(frequency) is. So far,when I am having problems with actually getting an incoming signal and figuring what that phase shift is. I'm not sure how I could use simulate signal to accuately and precisely send out a 40 kHz sine wave, and then vary that signal by steps of 1 Hz. I have also tried using a signal generator, and having once BNC cable go to the input of the transmitter and the other going to input of the DAQ. I have another BNC cable going from the output of the receiver to the input of the DAQ. I had multiple channels on my DAQ, and used split signals to see the transmitted and received signal. But this doesn't seem to be working. I also tried to add gain to the received signal, but when adding an Op-Amp LF356 to the receiver, the signal completely disappears. Attached are some of the VI's I have, but none of them seem to be working. Thanks in advance for any help. 
    Attachments:
    Latest version of final.vi ‏64 KB
    Draft for final project.vi ‏89 KB

    Have you done the basic physics and mathematics? For the speed of sound = 343 m/s and the frequency = 40 kHz the wavelength is 8.6 mm. At 40.001 kHz the wavelength is 214 nm shorter.
    So, how do you propose to keep track of the number of wavelegnths if the target moves more than 8.6 mm?
    To measure a phase shift you must have some kind of reference. Typically a fraction of the transmitted signal is used as a reference.  Since you probably do not know how much phase shift occurs in the power amplifier driving the transmitter or between the electrical signal at the transducer and the acoustic signal in air, it is usually best to measure both, ideally with the same receiver and amplifiers.
    The LF356 should be good for modest amounts of gain. The transducers can look like a capacitance to the circuits. Do you have a DC offset which is saturating the amplifier?
    Lynn

Maybe you are looking for