SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By shubhamshukla7
#190557
I am using a Sparkfun Electret Microphone with Arduino Pro-Mini to stream audio over serial port. The goal is to create a wav file from the audio data.

The wav file header requires "sampling frequency" as one of the entries in the header. Here are my questions:

1. How can I check what is the current audio frequency of the analogReads from the microphone on my arduino
2. How can I configure/change some settings in my arduino pro mini to get a sampling rate of 16 kHz (that's what one of my applications that will consume the WAV file requires)

By jremington
#190589
Can you rephrase question 1? It doesn't make sense.

In the default Arduino configuration, you cannot sample the analog signal more rapidly than 9.6 kHz (for 4.8 kHz maximum signal frequency). Whether you actually do that depends on your code. You can change the ADC register settings to achieve faster sampling. This is discussed here: http://www.openmusiclabs.com/learning/d ... tmega-adc/
By Elvestre
#192864
The sampling rate, sample rate, or sampling frequency defines the number of samples per second (or per other unit) taken from a continuous signal to make a discrete signal. For time-domain signals, the unit for sampling rate is hertz. The inverse of the sampling frequency is the sampling period or sampling interval, which is the time between samples.
Sample rate is usually noted in Sa/s (non-SI) and expanded as kSa/s, MSa/s, etc. The common notation for sampling frequency is fs which stands for frequency (subscript) sampled.
The Nyquist–Shannon sampling theorem states that perfect reconstruction of a signal is possible when the sampling frequency is greater than twice the maximum frequency of the signal being sampled, or equivalently, when the Nyquist frequency (half the sample rate) exceeds the highest frequency of the signal being sampled. If lower sampling rates are used, the original signal's information may not be completely recoverable from the sampled signal.

For example, if a signal has an upper band limit of 100 Hz, a sampling frequency greater than 200 Hz will avoid aliasing and allow theoretically perfect reconstruction.

*Oversampling

In some cases, it is desirable to have a sampling frequency more than twice the desired system bandwidth so that a digital filter can be used in exchange for a weaker analog anti-aliasing filter. This process is known as oversampling.

*Undersampling

Conversely, one may sample below the Nyquist rate. For a baseband signal (one that has components from 0 to the band limit), this introduces aliasing, but for a passband signal (one that does not have low frequency components), there are no low frequency signals for the aliases of high frequency signals to collide with, and thus one can sample a high frequency (but narrow bandwidth) signal at a much lower sample rate than the Nyquist rate.
Video Converter Factory Pro; it is an all in one and powerful video converter produced by WonderFox Soft, it is powerful fast and reliable and can help you convert both video and audio files, its rich parameter settings like setting the display resolution, bit rate, frame rate of your video files and sample rate, channels, bit rate, encoder and the volume of your audio files will surely help you get higher definition videos and good quality audios that you really need. What's more, it can improve audio quality, such as mp3 to aac, which is the a substitute for MP3 to provide better sound quality with the same bit rate.