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
0
votes
1 answer

How is signal frequency stored during pulse code modulation?

I am new to the concepts of Sampling and Quantization, and despite reading many articles, I am not clear on how PCM works if I record a simple sound. If I record the note A3 (220hz) at 44.1 KHz sampling rate, 16 bit quantization and mono channel for…
dev
  • 11,071
  • 22
  • 74
  • 122
0
votes
0 answers

How to render Spotify PCM stream on Windows

Currently I am trying to use the libspotify lib to write a Windows Spotify Player. I'm new to audio streaming but not to video streaming. I have the basics working for most of the user data and track info but the problem I'm having is that I can't…
Tommyg
  • 1
  • 3
0
votes
0 answers

error in the output using python?

input.txt: I am Hungry I am going home I am going to Germany complete code: class Part(object): """Represent a part in a multipart messsage""" def __init__(self, name, contentType, data, paramName=None): super(Part,…
sam
  • 203
  • 4
  • 17
0
votes
0 answers

how to save the response from the server in python?

input.txt: I am Hungry I am going home I am going to Germany complete code : """Represent a part in a multipart messsage""" def __init__(self, name, contentType, data, paramName=None): super(Part, self).__init__() self.name…
sam
  • 203
  • 4
  • 17
0
votes
1 answer

Plot PCM output in Matlab (MP3 decoder)

I am doing a mp3 decoder project and I have built a function to decode a song in mp3 format: function [PCM_output,frequency] = decode(mp3song) At the end of the code, I am adding a few lines to plot the PCM waveform: t=0:0.01:120;…
Ralph
  • 19
  • 7
0
votes
1 answer

PCM to MP3 using MediaCodec API Android

I am gettting PCM data from Microphone using AudioRecord class, how to encode it to MP3 using MediaCodec in Android?
0
votes
2 answers

PCM to WAV conversion in android

I have recorded a sound using AudioRecord class . But its not playable via music player. So I have added some header information to the audio file. Though its now playable via music player but its lagging and noisy , its not playing exact sound .…
Mushfiqul Tuhin
  • 666
  • 6
  • 13
  • 31
0
votes
1 answer

Noise in Merging two pcm files

I am merging two pcm data and the resultant pcm is having additional noise of grrrrrrrrrr. My code is : int main(void) { FILE *rCAudio; FILE *raudio; FILE *wtest; rCAudio=fopen("Audio1.pcm","rb"); //Reading first pcm file …
0
votes
1 answer

decode FLAC file with avcodec_decode_audio4 not work well

I use FFmpeg to decode my flac file and write it to pcm file, then use GoldenWave to play it with pcm signed 16bit, little endian, mono and the total play time is ok. I doubt i write the 2 channel file in one place, but i don't know how to get…
chaoqi
  • 7
  • 4
0
votes
1 answer

Apply volume to PCM samples producing static/noise?

I'm attempting to apply a volume limit to some PCM samples. However, whenever the volume I apply is anything but 1.0 heavy static/noise is produced (interestingly only for about 80% of the duration of the sound, the rest seems to play without…
yesbutmaybeno
  • 1,078
  • 13
  • 31
0
votes
2 answers

What is the least amount of (managable) samples I can give to a PCM buffer?

Some APIs, like this one, can create a PCM buffer from an array of samples (represented by a number). Say I want to generate and play some audio in (near) real time. I could generate a PCM buffer with 100 samples and send them off the sound card,…
user5225825
0
votes
4 answers

pcm16 to pcm14 conversion using add + shift

I am studying a sound converting algorithm where an array of signed shorts is received. At a given point in the algorithm it converts the samples from 16 bits to 14 bits, and it does it like this: int16_t sample = (old_sample + 2) >> 2; For me its…
Fail
  • 3
  • 1
0
votes
1 answer

avformat_write_header return error code when trying to write PCMU encoded frame into avi/mov file

I am trying to write PCMU G.711 enocded data into avi multimedia container using below program which yields Error occurred when opening output file: Operation not permitted and when using mov container, it yields Error occurred when opening output…
Kaidul
  • 15,409
  • 15
  • 81
  • 150
0
votes
1 answer

Muxing only audio into MP4 ffmpeg failed

I am trying to write audio encoded packets into a MP4 container.I have followed this sample code and instead of creating dummy frame, I am feeding real G.711 PCMU encoded frame into ffmpeg. The writing seems working and file size is increasing, but…
Kaidul
  • 15,409
  • 15
  • 81
  • 150
0
votes
1 answer

Convert PCM WAV to ULAW WAV in JAVA

I am Writing a web based Voice Recorder with a Javascript/HTML5/JSF frontend, and a Glassfish (Java) backend. I need to save the recorded .WAV file with ULAW encoding. However as far as I can tell the only way to record audio in HTML5/Javascript…