LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound output on the DAQ

Hi!

 

So I am using the myDAQ and I have an electret mic hooked up to ai0, and a thin speaker with circuitry on the ao0. I want to get a signal in from the mic, then send it out to the speaker, and I am able to, however, all I am receiving are digital beeps to the beat of a song and no real sounds like lyrics, which is what I want. I have attached my code, if you wouldn't mind looking at it and pointing me in the right direction if you can!

 

Thanks!

 

Alli

0 Kudos
Message 1 of 4
(2,880 Views)

Your mic is hooked up to ai0?  Your code is using ai1.

 

Your sample rate should be more in the 40kHz range.  The human ear can hear up to 20kHz.  According to Nyquist, you therefore need to sample at least twice that (40kHz).  To put things into perspective, a CD actually uses a 44.1kHz rate.  So with your sampling at 20kHz, you can only really detect frequencies up to 10kHz.  This could cut out some of your treble or make it appear as bass due to aliasing.


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 4
(2,860 Views)

If you do a search, you can find several examples of audio processing that use myDAQ, code included.  I think there may even be a YouTube video ...

 

Bob Schor

0 Kudos
Message 3 of 4
(2,856 Views)

To be fair, while the ear hears up to 20 kHz, the voice doesn't get as high.  With 10 kHz, we should hear SOME voice coming through if everything else is setup correctly.

0 Kudos
Message 4 of 4
(2,849 Views)