Re: Converting voltages to PCM audio (programming related)
- From: Jerry Avins <jya@xxxxxxxx>
- Date: Tue, 29 Nov 2005 12:29:03 -0500
vessep@xxxxxxxxx wrote:
Hello everyone,
I'm recording audio with a data acquisition card from the speaker cables. When recording, I get an array of unsigned short integer values. These I need to convert to PCM audio. Everything works quite nicely, except the fact that a lot of noise occurs in the PCM file. I'm using Measurement Computings PCI-DAS6036 -card, and I have tried this also with a simulated National Instruments PCI-4462 -card (the simulated card only gives a sine wave).
"These I get as a bunch of words that I need to convert to prose." The numbers you get are called PCM.
Taking an audio signal from speaker cables is usually a poor choice. The noise and hum out of the power amplifier may be insignificant when fed to a loudspeaker, but the signal is substantially degraded by them. If you have "Line out" available, use that. "Tape out" is also good. Usually, "Tape out" is unaffected by tone controls, and neither is affected by the listening volume.
What I have done is that first I reduce the received unsigned short values (1-65535) to scale them on the signed short value range (these are from MCC card, NI card gives voltages which I multiply to match the signed short value range). After that I write these values to a file as 16bit signed integers in little-endian format.
You lost me. You start and end with 16-bit numbers. Are you merely adjusting the volume?
And when this so called audio is played, it has a _lot_ of noise in it that can not be heard from the speakers or when recording from sound card. Waveform and amplitude are correct and you can hear the actual audio playing. So, is there something I'm missing? Can I convert the received values directly to PCM format? I would not like to filter the signal (nor could I since my knowledge of actual DSP is almost non-existent).
Describe the noise. I would expect hum, but your math may be flawed.
And last, but not least, please forgive me if this was an inappropriate choice for a newsgroup to ask about this matter. If any of you should know a more appropriate newsgroup, I really would like to know.
There are better choices. How about rec.audio?
Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ .
- Follow-Ups:
- References:
- Prev by Date: Re: LMS algorithm for noise cancellation in speech
- Next by Date: Re: Building a (cheap) software radio
- Previous by thread: Converting voltages to PCM audio (programming related)
- Next by thread: Re: Converting voltages to PCM audio (programming related)
- Index(es):
Relevant Pages
|