LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to shift Signal to be centered on Zero ?

 

Hi all,

 

I have a signal which is above X axis, How do I automatically center it at zero (on X axis) ? 

 

Thanks 

 

Message Edited by ACiDuser on 05-25-2009 08:55 PM
0 Kudos
Message 1 of 17
(1,977 Views)
Get the DC componet and subtract it. Look at the Basic Averaged DC-RMS and Averaged DC-RMS functions.
0 Kudos
Message 2 of 17
(1,963 Views)

You will have to subtract a value from the signal.  Store that "offset" value in a shift register.

Example_VI_BD.png

Message 3 of 17
(1,961 Views)
I forgot to mention - that I may don't know what exactly is that offset
0 Kudos
Message 4 of 17
(1,949 Views)
You could also try a highpass filter.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 17
(1,935 Views)

Hi Ravens Fan,

 

interesting but complicated approach. Can you explain why the shift register is necessary? What does the False frame in your case structure contain? How can the offset value be adjusted?

 

 

 

Regards,

Thomas

0 Kudos
Message 6 of 17
(1,916 Views)

Hi,

 

the offset is the difference between the center of your original signal and the X-Axis.

In other words: the offset value is the Y value at the center of your original (uncorrected) signal.

 

To shift your signals center to the X-Axis  (to Y=0) simply subtract the offset value from the original signal Y values.

0 Kudos
Message 7 of 17
(1,913 Views)

ThHagel wrote:

Hi,

 

the offset is the difference between the center of your original signal and the X-Axis.

In other words: the offset value is the Y value at the center of your original (uncorrected) signal.

 

To shift your signals center to the X-Axis  (to Y=0) simply subtract the offset value from the original signal Y values.


 

 

In an ideal world, there the DC is constant and know this will work. But if these parameters are changing, the only way is to make a digital AC coupling, by implementing a digital highpass filter. In labview this is easy. 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 8 of 17
(1,907 Views)

Hi Coq rouge,

 

you are right in case ACiDuser wants to remove a DC component of the original signal. I guess I misinterpreted ACiDuser's problem description. 

 

But still, at least a warning: take care not to mix up the problems offset-error and DC-component-error. It's not the same. If you try the filter approach for the offset-error you might end up with unwanted results.

 

See the difference with an example:

a measured signal contains an offset error caused by the measurement instrument. The measured signal value contains this offset error and the signal of interest. The signal of interest itself is alternating with different amplitudes at different levels (a DC-component is contained in signal of interest in this case). That's an indication for a simple offset correction using a subtraction (offset value might be constant or adjusted dynamically by hand or automatically if possible and necessary).

If you would remove the DC-component using a filter you would end up with a signal always altering along the X-axis and, of course, any DC-component of your signal of interest would be removed. Your signal of interest would be destroyed in this case.

 

So it depends what you want to do...

 

Regards,

Thomas

Message 9 of 17
(1,890 Views)

ThHagel wrote:

Hi Ravens Fan,

 

interesting but complicated approach. Can you explain why the shift register is necessary? What does the False frame in your case structure contain? How can the offset value be adjusted?

 


 

Not complicated at all.  It is just a way to rezero a signal.  You can't get any simpler than this unless you just put on a numeric control where you manually type in the offset value.

 

The shift register maintains the offset value between iterations of the loop.  The false frame just connects the wire straight through from the one shift register node to the other.  If you hit the Rezero button, it takes the current value at that moment and stores in in the shift register to subtract all future values from it. 

 

The example is just for reference.  I don't know where you are acquiring the data from or how many samples you are getting at once.  So I just make the DAQ input represented by a single scalar numeric control.  Some of the other messages discuss AC signals and doing filtering to get your offset value.  That is a more complicated solution.  The original poster didn't give any example as to whatthe signals look like so whether you need filtering or not is really unknown.

Message 10 of 17
(1,876 Views)