LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase correction trouble

Hello everyone,

 

For a research assignment I am doing measurements with a microflown, a device that consists of a particle velocity transducer and a microphone. I have this hooked up to a NI-PXI-1042Q. Unfortunately I have been running into some problems:

 

The amplitude and phase of both the particle velocity transducer and that of the pressure element are shifted; this is because of the physical properties of the device. This shift in phase and sensitivity is frequency-dependent. Correction (scaling) formulas are known, the calibration is OK, but I have problems implementing these formulas.

What I am trying to do is do a FFT on the pressure and velocity waveforms, and get an output consisting of a magnitude and phase. I subtract the phase shift from the phase output and divide the magnitude by the sensitivity, this should be theoretically correct. I attached a picture of the SubVI I use for this correction (the constant values are phase and amplitude cornerfrequencies).

 

The problem lies with the phase correction: phase information is often lost. The input signal is a random noise signal coming out of a speaker, so the signal is uncorrelated. Averaging the FFT means losing phase information, but I have trouble getting correct phase information even though I don’t average the signal. The sad part is that the amplitude correction doesn’t matter much for what I am trying to research, but phase calibration is of critical importance.

 

Does anyone see where I go wrong, or have any idea to reliably extract phase information from a random signal (could be anything, not just noise) that I can correct?

 

 

0 Kudos
Message 1 of 10
(4,421 Views)

Hi Big Philly,

 

Unfortunately I'm not quite sure what goes wrong in your application, but I would like to do some tests on this sub VI. Would it be possible for you to post this VI in this forum? 

 

I will than try to test the subVI and see if I can find the error that way!

 

Thanks in advance for posting.

 

Regards,

 

Peter S

Message 2 of 10
(4,354 Views)

Hi Peter S,

 

It is in the attached file. Thanks for the reply and taking the time to test it!

 

Phil

0 Kudos
Message 3 of 10
(4,347 Views)

Hi Philly,

 

Not totally sure what you are after either, however it looks like you are building up an array constant in the for loop labelled (freq) which is subsequently subtracted from your measured phase information.  Is this the desired approach or should it be the Measured Phase which is manipulated and then subtracted from itself?

I may have got it wrong but my thiunking suggests if you subtract a constant from a random signal, you end up with a random signal.  (Please feel free to shoot me down in flames if i have totally missed the point)  🙂

Craig

LabVIEW 2012
0 Kudos
Message 4 of 10
(4,332 Views)

You say that the corrections are frequency dependent, but it looks as though you apply the corrections to all elements of the FFT array.  There is nothing frequency dependent about that!

 

If the "1" corrections apply to f1 < f <f2 and the "2" corrections apply to f3 < f < f4 ... , then you need to separate the f1 ... f2 elements, apply the "1" correction, and replace the appropriate array elements.  Repeat for the other corrections.

 

The second point is that phase is not well defined for a random signal.  However, I presume that you are really referring to the phase of the transfer function rather than that of the signal.

 

Lynn 

0 Kudos
Message 5 of 10
(4,325 Views)

Hi Craigc,

 

Yeah, you may have missed the point though I understand where you're coming from. 

The loop labeled freq. is supposed to calculate an array or frequencies to go with the array of phases and magnitudes; f=f0 +i*df. The phase correction formula is as follows: 

 

 

And the magnitude correction (sensitivity):

 

 

That's the complicated math thingy I am trying to implement into the signal processing. The signal I am putting into the sensor is random noise coming out of a speaker, and I know that the phase is rather random, but the acoustic theory I am researching should hold for any acoustic source. So I am investigating a certain finite sample of noise and applying calculations on it, then getting another sample of noise and do the whole processing thing again... etc. so I can average the final outcome rather than the analysis of a random signal.

 

Hi Johnsold,

I am not sure if I understand what you mean. Are you sure that I am applying the same correction to all points of the FFT array? 

 

Anyway, I hope this helps understand what I am trying to do. 

Message Edited by Big_Philly on 06-09-2009 11:53 AM
0 Kudos
Message 6 of 10
(4,294 Views)

Just one thought, deg vs. radians

 

Your formula for phase correction is in deg, but the ATAN VI is in radians.

0 Kudos
Message 7 of 10
(4,291 Views)

Hi Alain S,

I don't think that matters. Whatever number you calculate the Arctangent of, there should be no difference in the outcome whether the output is in units of radians or degrees. (If you don't understand or don't believe me, pick a random number and use your calculator to calculate the arctangent in degrees. Then calculate it in radians. Then check if the outcome in radians is the same as the outcome  in degrees if you calculate from radians to degrees.)

What matters is consistency throughout the VI; if I measure the phase in degrees and then correct it using radians or vice versa there will be a problem. But I paid close attention to this.

Message Edited by Big_Philly on 06-09-2009 12:43 PM
0 Kudos
Message 8 of 10
(4,286 Views)

Phil,

 

Now that you have posted your correction formulas, I can see what you are trying to do.  It looks as though you have implemented your equations correctly.

 

Your diagram can be simplified a bit.  No need to wire f0 and df through.  The cluster connection to the middle terminal carries the elements which do not change.  Many of the arithmetic functions are polymorphic so you can mix wiring of arrays and scalars.

 

Lynn

Phase Correction.png

 

Message 9 of 10
(4,273 Views)

Hi Lynn,

Thanks for helping me out! I am still very new to LabView so tips like these help a lot.

 

Philip

0 Kudos
Message 10 of 10
(4,270 Views)