Questions tagged [pcm]

Use this tag for questions about the Pulse-Code Modulation representation of sampled signals.

Pulse-Code Modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form for digital audio in computers and various Blu-ray, DVD and Compact Disc formats, as well as other uses such as digital telephone systems. A PCM stream is a digital representation of an analog signal, in which the magnitude of the analog signal is sampled regularly at uniform intervals, with each sample being quantized to the nearest value within a range of digital steps. PCM streams have two basic properties that determine their fidelity to the original analog signal: the sampling rate, which is the number of times per second that samples are taken; and the bit depth, which determines the number of possible digital values that each sample can take.

Pulse-code modulation is an uncompressed audio encoding method. PCM is used in the .WAV, and .PCM file formats, and for encoding audio CDs, among many other uses. Digital signal processing algorithms like filters or FFT interact with the data when its in PCM format. When compressed audio format conversions are made, say from aac to flac, the data is converted from the source codec into PCM and then into the target codec. PCM can be considered the fundamental representation of digital time series data (EG. audio, financial ticker prices).

An alternative to PCM, with its sample rate and bit depth measurements, is the notion of storing the curve as a series of one bit samples. Instead of the ADC generating a sample of the absolute location of the height of the input analog curve when using the PCM approach, with this alternative one bit sample approach the ADC generates the relative position of the input analog curve. This one bit approach is memory efficient when performing very high sample rates.

780 questions
-1
votes
1 answer

how to create a simple iir low pass filter with not round errors? (16 bit pcm data)

i have an array of n length fullfilled by 16 bit (int16) pcm raw data,the data is in 44100 sample_rate and stereo,so i have in my array first 2 bytes left channel then right channel etc...i tried to implement a simple low pass converting my array…
-1
votes
1 answer

I am not able to output 32 bit float or 24 bit signed PCM data to the audio system

I am trying to write a program that outputs sound from an array to the speakers. I would like it to support the following formats if possible. I am using Windows as my OS. Unsigned 8-bit PCM Signed 16-bit PCM Signed 24-bit PCM Signed 32-bit Float…
-1
votes
1 answer

Read pcm file in node js to get raw data

The below code parses a sample pcm file var dataFile = 'C:\\Users\\\\Desktop\\small.pcm'; fs.readFile(dataFile, function(err, res) { if(err) { console.log('Error:', e.stack); }else{ var ampData = []; var arrByte =…
Abbas
  • 3,144
  • 2
  • 25
  • 45
-1
votes
1 answer

AudioTrack: should I use an Asynctask, a Thread or a Handler?

In Android: I am trying to play a wav file of size 230mb and 20 min whose properties are as below: ffmpeg -i 1.wav Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s The following is the code in android: …
Santhosh
  • 9,965
  • 20
  • 103
  • 243
-1
votes
1 answer

YUV/PCM Visualizer to measure Lip Sync

I have a two dump files of raw video and raw audio from an encoder and I want to be able to measure the "Lip-sync". Imagine a video of a hammer striking an anvil. I want to go frame by frame and see that when the hammer finally hits the anvil, there…
cjserio
  • 2,857
  • 7
  • 29
  • 29
-1
votes
1 answer

Android AudioRecord PCM to get DB

So far: byte data[] = new byte[recBufSize]; read = audioRecord.read(data, 0, recBufSize); long v = 0; for (int i = 0; i < data.length; i++) { v += Math.abs(data[i]); } double mean = v / (double) read; final double volume = 20 *…
-1
votes
1 answer

Android : Error While Playing a PCM File

I am trying to play a PCM file which was created while recording audio from the microphone. I am using AudioRecord because I want to analyse the frequency of the sound which is recorded by the microphone. The snippet of code which plays the PCM file…
shivram
  • 469
  • 2
  • 10
  • 26
-1
votes
3 answers

why this Code can't run in Java?

Possible Duplicate: unsigned short in java Conversion of Audio Format in JAVA i Have a code which convert ulaw music to pcm format The Code is programed by C , but now, i need it run in java the Code is like this short ALG_ulawDecode(unsigned…
Bird Hsuie
  • 690
  • 7
  • 15
-1
votes
1 answer

Process pcm wav streams in .net

I need process wave (wav) files uncompressed (pcm). As input i receive a wav in a stream (System.IO.Stream). I need do a few things: Get a new sound (wav) from a snippet of a other sound (wav) (by snippet i mean fragment of time) Join few fragments…
Jonny Piazzi
  • 3,684
  • 4
  • 34
  • 81
-1
votes
2 answers

Canceling noise given a LPCM array of 44 samples per second

I have an array of 44100 samples per second of LPCM data. Actually I have two channels worth of data. Every 11.61 milliseconds I get around 512 samples. Now I want to follow the directions on How to cancel noise from audio However, that explanation…
user605957
  • 2,489
  • 6
  • 25
  • 33
-2
votes
1 answer

Convert a stereo wav to mono in C

I have developed the Synchronous Audio Interface (SAI) driver for a proprietary Real-Time Operating System (RTOS) using C language. My driver is configured to output left and right channel data (I2S) to the amplifier. But, since the amplifier…
Mahad
  • 1
  • 1
-2
votes
1 answer

How to convert u-law and a-law encoded wav files to pcm wav file in c program?

I want to convert a-law & u-law wav files to pcm wav file in c program. How do I do that ? Will sox c libraries be useful ? Please help.
sushma
  • 1
  • 1
-2
votes
1 answer

how to apply window function on PCM signal?

can anyone please explain me or give some source for "how to properly apply 32 window function on a PCM signal ? I need this to perform fft on audio signal , but couldnt find out a proper way of doing it !
-2
votes
2 answers

How do I filter out out-of-hearing-range data from PCM samples using C++?

I have raw 16bit 48khz pcm data. I need to strip all data which is out of the range of human hearing. For now I'm just doing a sum of all samples and then dividing by the sample count to calculate peak sound level, but I need to reduce false…
sss123next
  • 295
  • 1
  • 3
  • 13
-4
votes
1 answer

Ffmpeg pcm to mp3 for android

-y -ac 1 -ar 8000 -f s16le -i xxx.pcm -acodec libmp3lame -ab 128K yyy.mp3 I use sampling rates of 8000, PCM convert mp3 is right. When I use sampling raets of 16000, PCM convert mp3 is wrong. How can I fix it?
K.Ming
  • 1
1 2 3
51
52