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
6
votes
2 answers

Sound pressure display for WAVE PCM data

The digital sound is playing using DirectSound device. It is necessary to display sound activity in decibels - like analog devices do. What is the right way to calculate sound pressure from the WAVE PCM data (44100 Hz, 16-bit)?
LicenseQ
  • 1,721
  • 1
  • 15
  • 21
6
votes
3 answers

Correct way to Convert 16bit PCM Wave data to float

I have a wave file in 16bit PCM form. I've got the raw data in a byte[] and a method for extracting samples, and I need them in float format, i.e. a float[] to do a Fourier Transform. Here's my code, does this look right? I'm working on Android so…
fredley
  • 32,953
  • 42
  • 145
  • 236
6
votes
1 answer

How to decode AAC compressed frames to PCM using AudioConverterFillComplexBuffer iOS

I want to implement SIP calls in my application, and first problem, that I need to solve, is converting audio from compressed AAC format with ADTS header to linear PCM. My input data is an NSArray of ADTS frames with different framesize. Each frame…
avsmirnov567
  • 176
  • 11
6
votes
1 answer

Writing 8-bit PCM sine wave wav file produces overtones

I wrote a program in c++ to generate a .wav file for an 800Hz sine wave (1 channel, 8-bit, 16000Hz sampling, 32000 samples so 2 seconds long), but when I play it or examine its spectrogram in Audacity, it has overtones. I think the problem is with…
Rob No
  • 61
  • 4
6
votes
1 answer

Play raw PCM audio received in UDP packets

The remote device is sending live raw PCM audio(no header included) in UDP packets and I need to implement a program in java to receive these packets and play them on the PC live. As I know that raw PCM's attributes are 16bit, mono, sampling rate…
6
votes
1 answer

How can I play raw PCM file that I dumped from a codec?

I'm debugging an audio codec and need to test if the data is coming out of a codec properly. I have my code dumping the raw pcm stream into a file and now I want to try to play it in VLC or another OS X compatible player. I've heard that this is…
Joey Carson
  • 2,973
  • 7
  • 36
  • 60
6
votes
1 answer

Deinterleaving PCM (*.wav) stereo audio data

I understand that PCM data is stored as [left][right][left][right].... Am trying to convert a stereo PCM to mono Vorbis (*.ogg) which I understand is achievable by halving the left and the right channels ((left+right)*0.5). I have actually achieved…
MOHW
  • 737
  • 1
  • 11
  • 23
6
votes
2 answers

How to resolve frequency from PCM samples

I'd like to build a an audio visualizer display using led strips to be used at parties. Building the display and programming the rendering engine is fairly straightforward, but I don't have any experience in signal processing, aside from rendering…
Joey Carson
  • 2,973
  • 7
  • 36
  • 60
6
votes
2 answers

Create valid wav file header for streams in memory

I have raw-headerless wav audio data as MemoryStreams. Stream rawAudioStream = Producer.GetRawAudioFileStream(...); I know those streams data format: // WaveFormat(int rate, int bits, int channels); WaveFormat waveformat = new WaveFormat(8000, 16,…
Hippias Minor
  • 1,917
  • 2
  • 21
  • 46
5
votes
4 answers

JTransforms FFT in Android from PCM data

I've been playing with this now for sometime, I cant work out what I am meant to be doing here. I am reading in PCM audio data into an audioData array: recorder.read(audioData,0,bufferSize); //read the PCM audio data into the audioData array I…
Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97
5
votes
0 answers

Converting a PCM file to .mp3 (Nodejs 12)

I'm making a Discord bot and at one point I have to save an audio with the PCM format voiceChannel.join().then(connection => { const fs = require('fs'); // Create a ReadableStream of s16le PCM audio var usee = message.member; const…
Zwoosks
  • 51
  • 3
5
votes
2 answers

Connecting AVAudioMixerNode to AVAudioEngine

I use AVAudioMixerNode to change audio format. this entry helped me a lot. Below code gives me data i want. But i hear my own voice on phone's speaker. How can i prevent it? func startAudioEngine() { engine = AVAudioEngine() guard let…
Daedelus
  • 266
  • 5
  • 14
5
votes
2 answers

What is the difference between Linear Quantization and Non-linear Quantization?

What is the difference between Linear Quantization and Non-linear Quantization ? I'm talking with regard to PCM samples. http://www.blurtit.com/q927781.html has an article about it but I'm looking for a more elaborate answer.
Namratha
  • 16,630
  • 27
  • 90
  • 125
5
votes
1 answer

Capture audio samples with a specific sample rate like Android in iOS Swift

I am a beginner in working with sound processing and AVAudioEngine in iOS, and I'm developing an application that captures the audio samples as a buffer and analyzes it. Furthermore, the sample rate must be 8000 kHz and also must be encoded as…
Mohamed Salah
  • 868
  • 1
  • 15
  • 34
5
votes
3 answers

Python u-Law (MULAW) wave decompression to raw wave signal

I googled this issue for last 2 weeks and wasn't able to find an algorithm or solution. I have some short .wav file but it has MULAW compression and python doesn't seem to have function inside wave.py that can successfully decompresses it. So I've…
Danilo
  • 1,017
  • 13
  • 32