LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determining frequency and amplitude of a real-time sampled current signal

Hi, I've tried to implement what you've said and I think the amplitude measurements are doing fine, however I don't think I'm obtaining the correct frequency, would you be able to tell me where I'm going wrong with this? Thanks

Download All
0 Kudos
Message 11 of 15
(655 Views)

What do you think the frequency should be? Your graph does not show both ends and has no time units so I cannot tell.  The Block-Oriented Amplitude Spectrum graph is probably reporting accurately.  The Tone Measurements VI outputs are not valid because you did not tell it what time scale (dt) to use.  The conversion from array to dynamic data type does not include any timing information.  That is a major drawback of the dynamic data type conversions. Without dt it probably assumes dt = 1. So scaling your frequency by 1/dt = 100 puts the data in reasonable agreement (if 10+ Hz is the right frequency).

 

I opened the Tone Measurements Express VI and found that it converts the dynamic data type internally to a waveform data type. The waveform datatype has an explicit dt component but the conversion process provides no opportunity to insert dt.  It uses something very like the Extract Single Tone Information.vi from the Signal Processing >> Waveform Measurements palette.  I would probably use Extract Single Tone Information.vi and explicity create a waveform with dt = 0.01.

 

Lynn

0 Kudos
Message 12 of 15
(647 Views)

Hi, I've attached an image of the front end graphs again with the time axis scaled by dt = 0.01. I expected the frequency to be around 5-10Hz, or rather, the range of frequency with which one is able to shake/fidgit one's leg on the ball of one's foot.  I think the frequency obtained is too high. Perhaps I'm using a wrong time scaling but I'm pretty sure it should be 0.01 because the loop the graphing code is being run in has a period of 10ms. Thanks

0 Kudos
Message 13 of 15
(622 Views)

I don't think I did anything to change my amplitude spectrum code, but now it's producing a frequency within an expected range. 

 

However, would you know why there is such a discrepancy between the amplitude detected from the amplitude spectrum and that from the extract tone .vi (as shown by the detected frequency and amplitude 2 indicators). It seems as though the amplitude from the spectrum is more accurate that the extract tone when compared to the actual current waveform in red. Please note that the spectrum and extract tone are receiving the same array of data.

 

Thanks

0 Kudos
Message 14 of 15
(620 Views)

Hi Hendrick,

 

I've read through this forum, and I see that you're using LabVIEW real-time and FPGA. Your post would be better answered in our real-time/FPGA forum which is also monitored by NI engineers. The link can be found here, and you can link that forum back to this one.

 

 

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 15 of 15
(596 Views)