Make voice recorder

Post here first, or if you can't find a relevant section!
Post Reply
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Make voice recorder

Post by saeed144 »

Hi everyone
I decided to make a voice recorder.
I know that I need a 44.1 kHz sample rate to cover the entire range of human hearing.
stm32f103 has 5MSPS ADC, can I use this?
by ag123 » Sun Sep 19, 2021 8:51 am
If sample rates isn't too high say < 100 ksps, you can try using a hardware timer to drive sampling and do an analogRead(pin), what is important is to set the pin mode pinMode(pin, INPUT_ANALOG); . analogRead() may be slow, if that is the case check the ref manual for your chip and figure out how to read the adc register, reading the register directly along with a timer can normally drive sample rates up to some 500 ksps.

using a hardware timer lets you fine tune your sample rates to high precision, nearly any sample rates you want. but the timer interrupt normally can't fire faster than 500 ksps.
Go to full post
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Make voice recorder

Post by ag123 »

You can try using an Electret_microphone on the ADC, a transistor pre-amp may be needed, u'd need to test that. The stm32 ADC has high sample rates into the 1-2 million samples per sec. So you can experiment with the sample rates easily.
https://www.ncbi.nlm.nih.gov/books/NBK10924/
Humans can detect sounds in a frequency range from about 20 Hz to 20 kHz. (Human infants can actually hear frequencies slightly higher than 20 kHz, but lose some high-frequency sensitivity as they mature; the upper limit in average adults is often closer to 15–17 kHz.)
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Re: Make voice recorder

Post by saeed144 »

Thanks for your reply
One more question: How to select STM ADC sample rate in Arduino IDE?
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Make voice recorder

Post by ag123 »

If sample rates isn't too high say < 100 ksps, you can try using a hardware timer to drive sampling and do an analogRead(pin), what is important is to set the pin mode pinMode(pin, INPUT_ANALOG); . analogRead() may be slow, if that is the case check the ref manual for your chip and figure out how to read the adc register, reading the register directly along with a timer can normally drive sample rates up to some 500 ksps.

using a hardware timer lets you fine tune your sample rates to high precision, nearly any sample rates you want. but the timer interrupt normally can't fire faster than 500 ksps.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Make voice recorder

Post by mrburnette »

saeed144 wrote: Sun Sep 19, 2021 7:56 am Hi everyone
I decided to make a voice recorder.
I know that I need a 44.1 kHz sample rate to cover the entire range of human hearing.
stm32f103 has 5MSPS ADC, can I use this?

Google this: stm32 + voice site=github.com

research: https://www.adafruit.com/product/1063
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Re: Make voice recorder

Post by saeed144 »

mrburnette wrote: Sun Sep 19, 2021 1:32 pm
saeed144 wrote: Sun Sep 19, 2021 7:56 am Hi everyone
I decided to make a voice recorder.
I know that I need a 44.1 kHz sample rate to cover the entire range of human hearing.
stm32f103 has 5MSPS ADC, can I use this?

Google this: stm32 + voice site=github.com

research: https://www.adafruit.com/product/1063
Thank you so much :)
Post Reply

Return to “General discussion”