answersLogoWhite

0


Best Answer

You cannot. Before we explain why, let's first examine how we actually record audio, then we'll look at how we convert it to the digital domain.

In order to record a sound wave, we first have to capture the vibrations made by the sound. Before the advent of electrical recording, this was achieved using a horn. This transmitted the sound to a moving stylus which vibrated in sympathy with the sound. When the vibrating stylus was brought into contact with a rotating cylinder, it etched a groove in the surface. As well as rotating, the cylinder also moved horizontally, thus the groove spiralled across the outer face of the cylinder. Once recorded, the same device could be used for playback; the rotating cylinder vibrated the stylus and those vibrations were amplified by the horn, reproducing the original sound.

With electrical recording we use a microphone instead of a horn. A microphone is simply a loudspeaker working in reverse. The microphone diaphragm vibrates in sympathy with the sound wave, which in turn moves a coil back and forth within a magnetic field, thus creating an electrical signal which is analogous to the sound wave. If we pass that same signal to a loudspeaker, we can recreate the original sound, just as we did with the horn and stylus.

The moving coil has a limited range of movement within the magnetic field. If we say that -1 represents the full extent inwards and +1 the full extent outwards, it follows that 0 is the transition point between the positive and negative phases of the sound wave. 0 is also the resting point of the coil when there is no sound at all. Although we are imagining numbers at this point, they are completely imaginary; we are still in the analog realm not the digital domain.

In order to convert the electrical signal for the digital domain, we need to take a snapshot of the coil's position at a given moment in time. For accurate reproduction we'd need an infinite number of snapshots, however the human ear is quite forgiving and we find that 44,100 snapshots per second (44.1 KHz) is sufficient to reproduce sound with high-fidelity. This is because the human ear has a frequency range of 20 Hz to 20 KHz, and we need at least twice as many samples per second to capture both the positive and negative phases of 20 KHz sound. CD-quality audio is 44.1 KHz for that reason. Once recorded we cannot improve the fidelity -- we can only lose fidelity -- however by using a higher frequency sampling rate, such as 96 KHz, we have sufficient fidelity to cater for all forms of mainstream digital media (such as BluRay). Fidelity is the physical difference between the original sound and the recorded playback of that same sound. At 44.1 KHz, most people won't notice any difference at all even though the physical difference is quite substantially different.

As well as the sample rate we need to consider how we store each sample. Given that the coil moves within a working range of -1 and +1, the position of the coil at any given moment can be converted to a real number within that range. However, although the range is relatively small, the set of real numbers within that range is as infinite as the set of all numbers; it's what we call a "small infinity" because it's an infinite set within a much larger set of infinities.

The only way to digitally represent an infinite set of values is with an infinite number of digits or bits. That's clearly impossible, so we need to limit our range in some way. With 16-bit recording we have 65,536 unique values available (all integers in the range -32,768 to +32, 767), thus we must scale our set of real numbers to fit within this range, rounding up or down to the nearest integer. Each additional bit doubles the range of integers thus the fidelity of 24-bit is 2^8 times that of 16-bit.

Now -- to answer the actual question -- converting analog audio to digital audio cannot be achieved with software of any kind, it can only be achieved with hardware. This stands to reason because software can only operate upon digital information stored in the computer's memory which means the conversion has to happen before the software "sees" that information; it cannot process what it cannot "see". But hardware can easily convert an analog electrical signal into a digital one, it's simply a matter of designing the appropriate circuitry.

To convert audio signals from analogue to digital we need a device known as an analogue to digital converter or ADC. The ADC takes a bandwidth-limited analog input (anti-aliased to eliminate all frequencies greater than half the sample rate) and produces a digital output. Once converted to a digital form, we can easily store it in a computer's memory. The conversion itself is trivially simplistic and is really no different to the way we would manually scale a real number in the range -1 and +1 to an integer in the range -32,768 and +32,768.

We can adjust the conversion insofar as we can amplify or attenuate the ADC input signal (the input gain), the sampling frequency and the bit-depth. But while we can perform these adjustments with software (communicating via the hardware's device driver), the conversion process itself is handled entirely by the hardware.

The reverse process is achieved with another piece of hardware known as a digital to analog converter or DAC, which converts the digital values back to electrical signals of the appropriate amplitude.

Note that not all sound originates in the analog world but must be converted to the analog world in order for us to hear it. For instance, computer-generated sound is entirely digital but until we pass it through a DAC (and subsequently through an amplifier and speaker) we cannot hear what it sounds like.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a c program to convert analog to digital signals using a sound port?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is needed to convert digital signals to analog signals?

DAC


Which device in pstn willl convert analog to digital?

You would utilize a VoIP adapter in the conversion of analog voice signals into digital IP packets. These adapters also have the ability to convert digital IP packets into analog voice streams.


What advantage do digital television signals provide over analog signals?

Digital signals produce a higher quality picture and many programs can be broadcast on a single digital channel, whereas only one program can be broadcast on an analog channel


Where would you find digital to analog in the computer?

You would find a digital to analog conversion taking place when you have a monitor with a VGA connection plugged into the computer. The computer would then have to convert digital signals into analog signals so the monitor could comprehend the data it is given.


How analog instrument interfaced with a digital instrument?

Analog instrument are interface with digital instrument with the help of analog to digital converter(ADC).ADC converts analog signals to digital signals.


What telecommunications hardware is needed to convert diitals signals to analog signals?

MODEM:A modem takes digital signal from computer and converts them to analog for the phone and reconverts them back


Will a set top box improve signal quality for your TV?

Set top box is basically used to convert the digital signals broadcasted by digital signal broadcasters to analog signals, in case you wish to have your analog tv, but would like to have an access to digital channels. Digital channels definitely have better quality signals than analog and therefore you will have a better picture quality and signal quality even though you have converted the digital signals to analog.


Which device is used to convert digital signals to analog signals or analog signals to digital signals?

The set top box that your provider gives you is what converts the Digital signal to the analog signal. The digital signal is compressed at the provider and sent to the end user. The "tuner" (which can be built into a tv, a set top box or a cable card) Then decompresses the digital signal and converts it into an analog signal. There is much more to this did not know how technical you wanted your answer.


7 What term is used to describe the transformation of analog signals into digital signals?

Transforming analog signals to digital is known simply as analog to digital conversion, sometimes shortened to A-D conversion.


What converts digital signals to analog signals and vice versa?

Digital signal is moreefficientimmune to noiseerror freethan analog signal.


What converts a message from digital to analog and analog to digital?

An DAC convert digital signal to analog signal i.e Digital to Analog Converter. An ADC convert analog signal to digital signal i.e Analog to Digital Converter.


What is it called when you convert a digital signal to analog?

When you convert digital signal to analog, it is called as an analog signal. The device used is called digital to analog converter.