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 .

Similar Messages

  • Phase shift a signal data

    hi all
              i want to phase shift a signal of 90 degree. i am having the signal data  as 1d array,using the data i want to shift the phase of the the signal .....any one....
    Indrajit
    | [email protected] | [email protected] .

    Hi Indar,
    You have several options--however the best is to devise a formula for the phase shift and then put this is the formula node in LabView to process the array data. Alternatively, you can use the Hilbert Transformation to apply a uniform phase shift to waveform data. Please refer to Echo Detector.vi or my simple example attached below.
    Ipshita C.
    National Instruments
    Applications Engineer
    Attachments:
    Hilbertwitharray.vi ‏90 KB

  • Phase shift

    Dear all,
    i have create a simple model to find the phase shift of 2 waveform using the dual channel spectral measurment model. My waveforms for both signal r of transient type, ie their phase shift is different from each cycle and as such i not sure abt the phase shift result.
    refer to attachment:my first graph is the signals of both waveform and the first cycle phase different is 11.28 degree and the second cycle onwards is 28.2 degree. the 2nd graphs shows the phase response of the both signal and the result is 24.2 degree.can some 1 pls advise me how those the dual channel spectral measruement model give the result of both waveform phase response as 24.2 degree.I am bluffed.
    urgent request.
    Cheers
    Shawn
    Attachments:
    PHASESHIFT.JPG ‏539 KB

    I am assuming that negating the result is not going to give you the
    right answer.  Then, you can try the inverse Hilbert Transform.
    Randall Pursley

  • 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

  • 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.

  • Determine phase shift ben input & output

    hello guys,
    I want to determine the phase shift between input and output signals. I want to measure the phase difference as lomg as I apply input. And save that to a file for reveiwing it later.Can anyone please help me with that. I am using Labview 7.1.
    Thanks,
      Jinal    

    Hi Jinio,
    Please take a look at the following KnowledgeBase article:
    How Can I Determine Phase Mismatch Between Two Channels?

  • 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 do I apply the blur filter to all my layers at the same time?

    Hi I'm working on a background for a web page and I want to try how different filters are going to affect all the layers. Is it possible to apply a filter to all the layers without flattening the file first? Thanks very much,
    Cathy

    Thanks very much , that's really helpful,Cathy
    Date: Thu, 23 Dec 2010 11:18:21 -0700
    From: [email protected]
    To: [email protected]
    Subject: How do I apply the blur filter to all my layers at the same time?
    Hello!
    There is no need to flatten the file, but you can create a layer that merges all the content of the image, and apply the filter on that layer.
    Target the topmost layer, by holding the Option and . (period) keys, then create a merged copy by holding down Command Shift Option E.
    >

  • How do i apply a modified selection?

    hi
    i have an already existing selection. i would like to add to it. once i have drawn the new additional selection and selected the ADD TO SELECTION command how do i apply it?
    angus

    The simplest way is to hold down the shift key while you make the additional selection.
    Or use the second option in the Options bar.

  • 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

  • Slow performance during Apply Request Values Phase of JSF lifecycle

    Dear all,
    I found that my application is sucked at the Apply Request Values Phase of JSF lifecycle when I submit the page. (Totally spend 1 min to pass this phase)
    In the application, there is around 300 input fields in the page. Who know how can I ehance the performace?
    Thanks.

    Thanks a lot for your help. Maybe I explain more about my current structure
    I need to develop a input form for course instructor to input students' assignment / examination result (max 9 assignments and 1 examination).
    so that I have below coding:
    *1. bean to store marks of a student*
    public class Mark {
    private String studentID = "";
    private String mark1 = "";
    private String mark9 = "";
    private String markExam = "";
    //getter & setter of above properties
    public void setMark1(String mark1) {
    this.mark1 = mark1;
    public String getMark1() {
    return this.mark1;
    *2. backing bean*
    public class markHandler {
    ArrayList<Mark> marks = new ArrayList<Mark>();
    //getter & setter of above property
    //method to retrieve list of student (this will be the action before go in mark input page)
    public void getStudentList() {
    //get student list from database
    for(int i = 0 ; i < studentCount; i++){
    //initial mark of student
    Mark mark = new Mark();
    mark.setStudentID(studentID);
    mark.setMark1("");
    mark.setMarkExam("");
    //put into arraylist
    marks.add(mark);
    *3. mark input page*
    <html>
    <h:dataTable value="#{markHandler.marks}" var="e">
    <column>
    <h:output value="#{e.studentID}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.mark1}" />
    </column>
    <column>
    <h:input id="mark1" value="#{e.markExam}" />
    </column>
    </h:dataTable>
    <h:commandButton action="#{markHandler.save} />
    </html>
    When I submit the page, It seems that there is a long time spent at the input field of datatable at Apply Request Values Phase. (I use Phase Listeners to test the time difference before & after phase)
    Pls help. Thanks.
    Edited by: Daniel_problem on Aug 15, 2008 10:34 AM
    Edited by: Daniel_problem on Aug 15, 2008 10:36 AM

  • 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

  • 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

  • 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

  • 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

Maybe you are looking for

  • Logical Name and Physical Name of OWB Objects?

    Hi, I am using OWB 10G R1. Version: 10.0.1.0.4 I would like to know, is there any table/script to get list of physical name and logical name of OWB objects (mapping / process flow). Any help would be appreciated greatly. Thank you, Regards, Gowtham S

  • Why wont my itunes 11.4 open on my mac?

    Hey I have iTunes 11.4 on my Macbook OS X 10.6.8 It won't open but it will bounce on my dock three times then stop. I've reset Macbook, Looked for a software update and have also looked in app store for update. Any suggestions?

  • App store and countries

    Does anyone know, why Apple divides App Stores by country? My two issues are: 1. I am a russian guy working in South Korea, so I need both stores. Russian, because it's my native language and I want to keep in touch with my homecountry; and korean, b

  • PDF Art box settings in InDesign

    Hi Experts, Is there any option available in InDesign to set PDF art box option in InDesign? We are using InDesign CS4 (Windows)

  • UWL : Opening workitem in Same screen

    Hi experts,    I use Universal worklist to see the workitems in the SAP inbox. Users doesn't like to navigate between screens. If he clicks the workitem in the top he want to see the details step in the bottom without navigating between screens. for