05-07-2016 02:32 PM
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
05-07-2016 07:42 PM
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.
05-07-2016 08:21 PM
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
05-07-2016 08:35 PM
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.