ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

analog signal smoothing

I have a LVDT analog signal that I need to plot to a waveform chart for a test that is running at 5hz. The signal is very choppy and unreadable. If I slow it down to say 1hz or less the plot looks like a nice sine wave, which is what I am looking for. What can I do to acheive this at 5hz. Thanks in advance for help and advice.

0 Kudos
Message 1 of 15
(5,060 Views)

What is the bandwidth of your signal?  If it is choppy as a higher frequency, that either means you are missing parts of your signal or you have a lot of noise.

 

Implementing a simple moving average typically works for me, but it really depends on your system.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 15
(5,058 Views)

I am using a USB-9162 with a 9215 Analog input module. I am using a Daq assistant with continous sample at a rate of 10k and 1k samples.I played around with a simple moving average, doing a For loop average and doing a sample compression and collection but that made it worse. I'm not sure of the band width. It looks beautiful at a slower LVDT stroke rate. How can I buffer the signal at a higher hz to look the same?

0 Kudos
Message 3 of 15
(5,054 Views)

This doesn't make sense.  If you're looking at the ANALOG output of an LVDT you should see the same frequency out as you used to excite the primary coil.  It's the phase and amplitude that provide the positional information of the stroke.  Are you sure your LVDT isn't demodulating internally?  What kind is it?  How are you exciting its primary?

 

Also post your code so we can look at your DAQ settings...

 

EDIT:  BTW, you should need to do ANY kind of averaging or "sample compression and collection" (whatever THAT is Smiley Frustrated).  LVDTs are inherently quiet and the output signal should be nice and clean if everything is hooked up right. Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 15
(5,045 Views)

Ok, let me make sure I have this straight.

 

You have a LVDT sensor going into a DAQ board.  You are sampling at 1kHz or 10kHz.

When the stroke rate is 1Hz, it looks good.  When the stroke rate is 5Hz, it looks bad.

 

Is that correct?

 

Can you share what code you have?

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 15
(5,044 Views)

Yes, in order to get enough data points to plot a nice readable chart in excel I am reading 2500 samples at 10000 samples per second.

0 Kudos
Message 6 of 15
(5,040 Views)
0 Kudos
Message 7 of 15
(5,039 Views)

What is your frequency of the excitation?  You should be sampling at well above twice that frequency.

 

I am noticing that you are only doing calculations on the first data point.  Your conversion from the Dynamic Data should output an array of doubles.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 15
(5,036 Views)

I am not sure the frequency of the excitation but the trans tek power supply has a range to 400hz. Right now I am sampling 1500 samples at 100khz. The plot on labview is ok but when I write to file, I am only getting 65-70 samples per second. In order to plot the sine wave of the LVDT as it traverses in and out at 5hz, I need aboout 200 samples per second. How can I achieve this. And why should I be converting the Dynamic Data to an array of doubles, I am only reading a sinbgle scalar. I would have to index the array anyway wouldn't I?

0 Kudos
Message 9 of 15
(5,011 Views)

@tavwtby wrote:

And why should I be converting the Dynamic Data to an array of doubles, I am only reading a sinbgle scalar. I would have to index the array anyway wouldn't I?


No you're not.  Your DAQ Assistant is getting 1000 samples from 4 different channels.  You are throwing away 999 samples from channel 0 and all of the other channels.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 15
(5,006 Views)