Re: Converting voltages to PCM audio (programming related)



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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
.



Relevant Pages

  • Re: Why are sound ioctl calls so slow?
    ... to go downstairs and fetch the paper before audio would start to play. ... My reference is NetBSD from more than a year ago, ... In particular, when playing back audio on one card, starting or ending ... Comparably, when making a recording, and then starting or ending audio ...
    (freebsd-current)
  • Re: Rip BitRate !!!
    ... would apply to a single channel mono recording. ... It is quite easy to use an uncompressed PCM CD standard audio file on ... being the PCM wave and the test signal being a compressed format, ...
    (microsoft.public.windowsmedia.player)
  • Re: OT: Digitizing My LP Collection
    ...  My cheap phono preamp and on-board audio aren't ... sound card will cover this without difficulty. ... I do favor using a card with more than 16 bits of real linear capture ... Recording and processing vinyl takes an unreasonable amount of time, ...
    (sci.electronics.design)
  • Re: Shaky image
    ... the capture card isn't used right? ... see a way to solve this IRQ sharing problem because it is a mini PC ... > that the audio is at 1.0x "real time" this means, in general, if there ... Do you have any problems if you play a recording using Media Player ...
    (microsoft.public.windows.mediacenter)
  • Re: Shaky image
    ... I recall MCE user had a problem with HT enabled, however, I don't remember ... > between the Hauppauge capture card and the nVidia VGA. ... >> are any problems with the audio there will also be problems with the ... Do you have any problems if you play a recording using Media Player ...
    (microsoft.public.windows.mediacenter)