Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

analog to digital

Status
Not open for further replies.
Now the sampling theory states that applying Nyquist criterion is the solution, but how to determine the frequency of random sound?(there's no silly question but there's a silly answer, right ?), if I'm gonna double it to obtain the sampling frequency?

Sound is not random. The human ear can only year sound from 20Hz to 20,000Hz so your maximum frequency of interest should be 20,000Hz. Most audio applications leave some room for error with their filters because of aliasing. So the generally used sampling rate is 44.1Khz, some higher end equipment has a sampling rate of 196Khz which is completely unnecessary.

As for the 8bit audio, you can easily find a 16bit microprocessor for better audio quality.

be aware you need to implement some signal conditioning to get the maximum benefit of your input microphone.

If you really want to know how to do all this and understand it, I would advise you to study electrical engineering. Or at least take a course on, microprocessors, Signal Processing and digital logic. To take those courses you need to study Differential Equations which means you need to study calculus..... and you should go to college to learn EE
 
Last edited:
jewdai. 44.1khz is the BARE MINIMUM sampling rate required to produce a SQUARE wave at 22.05khz, IE the Nyquist limit. High fidelity audio basically doubles that to a 96khz sampling rate which is much more sensible. For truly hi-fi audio 196khz is perfectly understandable, it reduces distortion in the higher frequencies and maintains phase for higher frequencies. Phase difference is very important mainly for surround sound especially with multiple channels.

So its not an issue of base frequency reproducibility more oversampling for the lower ones. At a 198khz there are only 8 samples for a full cycle of a 22khz sine wave. That's BARELY okay for high quality phase reproduction at those frequencies.
 
Last edited:
jewdai. 44.1khz is the BARE MINIMUM sampling rate required to produce a SQUARE wave at 22.05khz, IE the Nyquist limit. High fidelity audio basically doubles that to a 96khz sampling rate which is much more sensible. For truly hi-fi audio 196khz is perfectly understandable, it reduces distortion in the higher frequencies and maintains phase for higher frequencies. Phase difference is very important mainly for surround sound especially with multiple channels.

So its not an issue of base frequency reproducibility more oversampling for the lower ones. At a 198khz there are only 8 samples for a full cycle of a 22khz sine wave. That's BARELY okay for high quality phase reproduction at those frequencies.

Unless everything I've learned about electrical engineering over the last few years is wrong. 44.1Khz picks up up to 22.05Khz SINE WAVES!!! We are talking about reconstructing the original digital message via digital to analog converter.

Remember the Fourier Transform of a Square wave is a SINC FUNCTION whose bandwidth is approximately F/2 where F is the frequency of the square wave. Remember that the sinc function is CENTERED at f = 0 and therefore the highest frequency of interest is F; therefore, in order to capture and reconstruct a square wave you need to sample it at F which meets the Nyquist sampling requirement.

because Fs = Max Frequency * 2 = F/2 * 2 = F


Lastly, From all of this:

Audio Applications require a minimum sampling rate of about 44.1KHz, remember when you are reconstructing the signal to you need to pass it through an ANTIALAISING filter because of the spectral replicas of the fundamental frequencies of interest.

I am digressing: Sampling rates tremendously above 44.1KHz sound, in theory, amazing and are often used as a selling point. Realistically, they are completely unnecessary. Its a waste of money to invest in it and it costs a lot of hard drive space to store a 24bit level audio sample.

if you want to get less precise parts, i would advice maybe going a little higher on sampling rate so you can use a cheaper low pass filter to reconstruct the signal.

good luck.
 
Last edited:
Audio Applications require a minimum sampling rate of about 44.1KHz, remember when you are reconstructing the signal to you need to pass it through an ANTIALAISING filter because of the spectral replicas of the fundamental frequencies of interest.

In fact, it's possible to sample sound with a smaller frequency. As Sceadwian said, human voice is clear (well, it's not thaaat clear, but it's 'understandable') when it's sampled with frequencies as low as 8k.

Sampling sound with smaller frequencies just mean that you won't be getting the higher frequency components of it. That's not really a problem depending on the application. Sometimes you just don't want high fidelity and you can live with some noise.

The higher frequencies of sound, when it comes to human voice, carry little information. In fact, when we get old, our ears get much worse at detecting frequencies higher than 12~15 kHz.

Also, the frequencies at which our ear is most sensitive are the ones comprised between 2 and 5 kHz, and these are coincidentaly (blame it on Darwin!) the frequencies that matters most to human voice understanding.

Best of luck on your project :)

Castilho
 
Yepp, thats why telephones if I remember correctly only have a sampling rate of about 8Khz.

My point is if you want to have immaculate sound quality you need at least 44.1KHz sampling. If you dont care about the higher frequencies you can sample it lower.
 
Unless everything I've learned about electrical engineering over the last few years is wrong. 44.1Khz picks up up to 22.05Khz SINE WAVES!!! We are talking about reconstructing the original digital message via digital to analog converter.

Remember the Fourier Transform of a Square wave is a SINC FUNCTION whose bandwidth is approximately F/2 where F is the frequency of the square wave. Remember that the sinc function is CENTERED at f = 0 and therefore the highest frequency of interest is F; therefore, in order to capture and reconstruct a square wave you need to sample it at F which meets the Nyquist sampling requirement.

because Fs = Max Frequency * 2 = F/2 * 2 = F
Fourier transforms apply to aperodic functions. I think you were thinking of a square pulse. A square wave is periodic, and its Fourier series consists of the fundamental and odd harmonics that theoretically extend to infinity. The amplitude of each harmonic is 1/n times the amplitude of the fundamental, where n is the number of the harmonic.
The Nyquist rate is two times the frequency of the highest harmonic that is deemed to be significant, and is definitely not F, where F is the fundamental frequency.
 
Actually, it works ESPECIALLY for periodic functions.

A Fourier Series can be constructed from the Fourier transform.

The Fourier transform for a periodic function is the Fourier transform of just one period's worth data.


Let me say this again:

the forier transform of a Square wave has a bandwidth (that is the -3dB point) of F/2 where F is the freqency of the SQUARE WAVE NOT A SINE WAVE; however it is useful for determining the bandwidth.
 
Last edited:
Jewdai, you should really get your professor's lecture notes.

And loose the attitude :)

You're right about the Fourier Series being a special case of the Fourier Transform.

In fact, the Fourier Transform of periodic functions IS the Fourier Series.


The Fourier transform for a periodic function is the Fourier transform of just one period's worth data.

Nope. Again, the Fourier Transform of a periodic function IS its Fourier Series.

See, for instance, Oppenheim & Schaffer. I'm with it by my side right now. It's a truly enlightening book.

Roff is right when he said that the square wave (emphasis on wave) is an unbounded signal. Try to put a square function on an ADC without proper filtering. If the ADC is good enough (meaning that it has enough resolution to see the higher frequency harmonics, that are much weaker than the fundamental) or the frequency of the square wave is close to the sampling frequency (close enough for the third or fourth harmonic alias images to be seen) you WILL see aliasing. It's a fact. I have seen it at college.

Do you know, by the way, why is it impossible to obtain a square wave with sharp edges?



I wouldn't say you were wrong when I saw your mistake. We all make mistakes, it's normal. As it were off-topic, I decided to keep it to me.

But you're reply to Roff was really impolite.

Im thinking i should post my professors lecture notes on this, or let you guys play with the FFT algorithm on Matlab to work this one out.

Why so stuck up? This was unnecessary.


Castilho
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top