LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect frequency of an analog signal coming in through myRIo AudioIn analog port

Solved!
Go to solution

I am working on a fire-fighting robot that runs using myRio. I have a small mic plugged into the 'AudioIn' port of the myRIO and the robot has to detect a certain frequency(2.8 or 3.5 KHz) to start navigation. The AnalogIn express VI gives me raw voltage amplitudes of type 'Double' but the 'Tone Measurment' vi I wanted to use takes in a 'Signal' data type. I tried converting the raw data to dynamic data and feeding it in but did not work. One problem is that I cannot control the sample rate of the AnalogIn express VI (LabView 2013), I appreciate any suggestions on how to go about doing it.

0 Kudos
Message 1 of 6
(3,958 Views)

Please....its very urgent.

0 Kudos
Message 2 of 6
(3,895 Views)

When is the homework due?

 

Have you tried not using the Express VI?  There are excellent tutorials on DAQmx on NI's Web Site, one of which shows you how to do most of the "useful" functionality in DAQmx with only 8-10 functions.  I'm sure you'll be able to specify your sampling frequency that way.

 

BS

0 Kudos
Message 3 of 6
(3,883 Views)
Solution
Accepted by topic author bayoim123

If you install the myRIO 2014 High Throughput Add-on you can use the Audio Input Express VI to sample between 1 kHz and 30 kHz.

 

You will have to follow the instructions in the LabVIEW 2014 myRIO Toolkit Readme in the section titled Switching between Default and High-Throughput FPGA Personalities.

 

There is also a thread on the LabVIEW MakerHub where the High Throughput toolkit was used to generate sound so it might be a good resource for getting part of the way there.

 

If you are using NI-DAQ hardware you can get access to the DAQmx driver but the myRIO cannot use the DAQmx driver to sample data.

 

 

Edit: You may also get more myRIO specific help by moving the post to the Academic Hardware Products (ELVIS, myDAQ, myRIO) discussion forum.


Milan
0 Kudos
Message 4 of 6
(3,868 Views)

Thank you all for your feedback.

 

@Bob_Schor the robot competition is tomorrow. Thanks for the suggestions but the High Throughput Add-on turned out to be what I was looking for.

 

@MilanR thank you so much. I installed LabView 2014 and the myRIO 2014 High Throughput Add-on and I now have access to low level VIs that will let me control sampling frequency and number of samples.

 

I am now using 'Tone measurments' to measure the frequency of the sound. But the frequency measured is not accurate, but it is atleast consistent. I am sampling at 7 KHz and taking 5000 samples at once. The two frequencies I want to detect are 2.8 KHz and 3.5 KHz. However, the mesaured frequecies I get from Tone Measurment VI are 0.400 Hz and 0.499 Hz, which are always consistent. Picture is attached below.

0 Kudos
Message 5 of 6
(3,842 Views)

Hi bayoim123,

 

Thanks for making a new thread for the new question. For others browsing the forum, this question (about 2.8 kHz signals showing up as 0.400 Hz) can be found in bayoim123's thread here.

 

Friar Tuck

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 6 of 6
(3,784 Views)