12-08-2010 09:01 AM
I want remove DC level of my AC signal and want to bring it back such that, it starts from zero.
It will be great if anyone can suugest this simple VI for me. I am new to LabVIEW.
12-08-2010 09:18 AM
Hi virtualworld,
how do the data looks like? Is it an array of numbers? If it is so, then I would suggest a "For Loop" in which you delete the DC portion of each array element.
Kind regards, Roman
12-08-2010 09:24 AM
What exactly are you having problems with? Do you know what the DC level is? Do you need to know how to measure it? have you taken a look at the measurement functions that exist in LabVIEW? Do you need to know how to remove it from a signal? What kind of signal do you have? Do you have dynamic data? Is it a waveform datatype. So many questions, so little information...
12-08-2010 09:25 AM - edited 12-08-2010 09:26 AM
@RomanD wrote:
Hi virtualworld,
how do the data looks like? Is it an array of numbers? If it is so, then I would suggest a "For Loop" in which you delete the DC portion of each array element.
Kind regards, Roman
Or, you could just do this:
I vote for the easy way. How about you?
12-08-2010 09:28 AM
Thank you smercurio_fc! I am still thinking in C...
12-08-2010 09:44 AM
Well I am sorryhere is some more useful information...
Its Temperature output in my control design and simulation loop, which looks like this (Results of Matlab/Simulink). You see how DC level is removed and cycle starts from zero.
Thanks in advance.
Kunal
12-08-2010 09:49 AM
One of the hardest things about coming to LabVIEW from some other language is learning about ALL THE CRAP YOU DON'T HAVE TO DO ANYMORE.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-08-2010 09:57 AM
If you know independently what the DC level is, then it's one thing to subtract a constant value from a signal array and be done with it.
If you are trying to DETERMINE the DC level from the signal itself, then you have some things to watch out for.
A simple average won't get the right answer, unless the signal is symmetric about 0.
And an average won't be computed correctly unless you have an integral number of cycles in your sample block (the data that you average).
If you have 1.5 cycles in your block, then the average of that block is skewed, because you have more data on one side of the true average than you do on the other.
That effect is reduced by a longer block with more cycles, but it's still there.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-09-2010 02:19 AM
Seems to me that you have to determin the minimum value and substract that.
For arrays and waveforms there is a ready vi to get the min /max of the values.
12-09-2010 09:40 AM
I believe the following code will do what you wish to do. First calculate the DC component of the waveform, then subtract it from the waveform itself then calculate the AC component. As you can see you cannot subtract the DC component of the total RMS value and get the correct answer.