LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency and duty cycle measurement

Hi Suneel,

The graph should function the same in an executable as it does in the VI.
Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 31 of 39
(1,665 Views)
Hi All,
 
Thanks for supporting me with all your posts.
But with the current implementation.
Frequency and duty cycle measurement is not clear.
i mean appropriate values are not coming when compared with the CRO O/P.
 
So i feel that my original logic should be changed.
Please see the attached image and let me know if any other option is available with using formula node or direct calculation
 
Your help would be mostly appreciable.
 
-Suneel.V
0 Kudos
Message 32 of 39
(1,638 Views)
Hi Suneel,

Can you be more specific as to what values you are getting, and what values your expect?  I noticed you are still using Timing and Transition Measurements, are you doing any preprocessing on your signal before sending it to that VI?  That VI will probably not yield satisfactory results with raw sound data.
Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 33 of 39
(1,623 Views)
Hi Jeremy,
 
Thanks for ur prompt response.
The req. is something like this.
With the help of sound recorder available in PC i will record a beep sound from a DUT.
The recorded beep sound would be saved in the hard disk as s1.wav
Now with the help of the labview the
  • user should be able to read this s1.wav
  • And once the graphical form of s1.wav is displayed he should be able to select a portion of the .wav
  • extract that and give that to the frequency and duty cycle calculator (currently timing and measurements)
  • Show the duty cycle and frequency as indicators.

This is my proper requirement, plz let me know if you are still unclear abt the req.

-Suneel

0 Kudos
Message 34 of 39
(1,616 Views)
Hi Suneel,

There is a function in the Signal Processing palette called Y[i] = Clip{X[i]} which can clip a waveform.  This might be useful to clip your sound signal into a square wave, which should then work better with Timing and Transition Measurements.  Timing and Transition Measurements by itself will not yield a correct duty cycle with sound data.


Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 35 of 39
(1,599 Views)
Hi Jeremey,
 
I tried with the clip waveform.
Attached is the error coming with Timing and Measurements...
whereas tone and measurements is working fine.
 
Please see the VI attached.
 
-Suneel 
0 Kudos
Message 36 of 39
(1,588 Views)
Hi Suneel,

I've thought of a flaw in my original idea.  Clipping the signal probably won't help, because we'd end up with squared off wave for each cycle, rather than a square wave representing the duty cycle of your sound pulse on time.  I think a better approach would be to approach your signal as an amplitude modulated signal, and we want to demodulate it. 

I would first low pass filter the signal to remove the carrier frequency.  You will want the cutoff frequency set so that you remove the carrier frequency, but not the pulse frequency.  This should give you an array of RMS values, and the waveform should be looking close to a square wave at this point.  Then, you can do limit testing to set thresholds for what RMS level you want to consider a high, and what level you want to consider a low.  You can then convert the resulting array from the limit testing to a square wave, and then do timing and transition measurements on that.

Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 37 of 39
(1,570 Views)
Hi Jeremy,
 
Sorry yesterday i was on a vacation.
Theoritically that looks interesting, i'm putting your words technically (Labview form) and trying to debug.
Let me know if i miss the track.
1 . A lowpass filter should be kept after Extracted waveform 1 (i.e only Equi-Ripple LowPass.vi available in my L.V. 8.2.1)
2.Cutoff freq set to that to remove the carrier freq. (here Stop freq say)
3.That should give me an array of values.
4.And then waveform should be looking close to a square wave input.
5. What do you mean by this setting thresholds? (Do you mean from the same Y[i]=Clip{X[i]})
 
Shall i proceed like this?????
 
-Suneel
0 Kudos
Message 38 of 39
(1,552 Views)
Hi Suneel,

I think you're on the right track.  What I mean by carrier frequency is your audio frequency.  So, say you have a 1 KHz tone, and you are pulsing it on and off at 20 Hz.  You could set your filter cutoff to 500 Hz, which will remove the 1 KHz audio and leave the 20 Hz on/off component.  The limit testing will test each point of your filtered signal against a threshold, so you'd end up with a True value if the signal is within the limits and a False if it is outside of the limits.  You can set the limit somewhere in between the amplitude of your on signal and that of you off signal.  You can then convert the resulting boolean array to numbers, and now you have a clean square wave to compute the duty cycle with.
Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 39 of 39
(1,537 Views)