Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

pwm to analog in spreadsheet

Hi all,
 
This isn't a labview problem more a excel calculation question.
 
I have an digital accelerometer that produces a changing PWM that represents G-forces.  I used labview to record the 4kHz PWM from all three axis.   Sampling rate 100kHz.
 
My question is with using excel.  For the PWM signals that I recorded, how do I calcuate in excel to convert the PWM into an analog value for graphing?  PWM is obviously a digital signal but is there a way to easy use PWM to represent G-forces?  All the recorded inputs must be digital signals so I have to do the dac conversion in excel.
 
Thanks.
0 Kudos
Message 1 of 2
(6,297 Views)
Hi immortalc,

I'm not sure excel is very suited to doing this type of calculation. You could definitely use LabVIEW to analyze the data. Since your data was sampled at 100kHz the time between each sample is 1/100k or 10 uS. You could then count the number of samples in each low period and times it by 10uS to calculate the low pulse width.

If your DAQ hardware has a counter available you can make a pulse width measurement in hardware using a counter input task. A great example of this can be found in the NI Example Finder. In LabVIEW go to Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Counter Measurements >> Meas Pulse Width-Buffered-Cont.vi. If you are measuring 3 axis then you would need a counter for each one.

Let me know if you have any questions and take care.

Thanks,
Nathan
NI Chief Hardware Engineer
0 Kudos
Message 2 of 2
(6,283 Views)