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
0 answers

how to reduce input quality from mic in objective c?

I'm creating VoIP app. I want to reduce the size of the audio file with: AVAudioPCMFormatFloat32 formatted. when I recording audio with handsfree and compressed the leaner PCM is good and reduced size but when I record with main-mic compressor not…
ehsan
  • 91
  • 1
  • 5
0
votes
0 answers

How to get PCM data from an mp4 file without converting to wav

I am attempting to get PCM data from mp4 files without converting to a wav file, so that I can perform FFT. I am currently using NAudio to perform this and AForge for FFT, but I am open to using other libraries to do this. The output values when…
Carsey
  • 1
  • 1
0
votes
0 answers

alsa not playing the complete file

I am trying to read a wave file and play it on one of the sound cards on the board. Below is the code. I am facing several problems with this code. I am trying to play files with various sample rates. With a file of Sampling rate of 8KHz, File…
Rohit Walavalkar
  • 790
  • 9
  • 28
0
votes
1 answer

How to decompress just one frame using NAudio?

I am simply trying to take any or first frame from an mp3 file and then decompress it. internal void Read3(string location) //take in file location { Mp3FileReader mp3 = new Mp3FileReader(location); //make a Mp3FileReader …
user7037473
0
votes
1 answer

How can I convert audio to WAVE_FORMAT_PCM using FFmpeg?

I am using Python's wave module to read audio, and using FFmpeg to convert audio from other types to wav. However, I am encountering some problem. I wrote v.py to generate an silence audio file a.wav import sys, wave, math import numpy as…
Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32
0
votes
0 answers

How do you decode interlaced S24_3LE from ALSA C++ API?

I am doing acoustic research and need to get waveforms from several mics. I have a Steinberg UR44 which records in S24_3LE. It has 6 channels. I know that per sample it generates 3 bytes, and that all 6 channels is encoded in these 3 bytes. But I…
Chaser
  • 1
0
votes
2 answers

How to read raw audio data in c++?

I'm trying to do a Fourier Transform on audio file. So far I've managed to read the header of the file with the help of this answer. This is the output. The audio format is 1 which means PCM and I should really easily be able to work with the data.…
That Guy
  • 154
  • 2
  • 14
0
votes
0 answers

How to avoid distortion when mixing two PCM samples?

I am making a music application where I need to join the user's voice with the instrumental music. In achieving this, I need to decode the instrumental music into PCM and combine it with user's voice. The algorithm I used to combine the music is…
Dana Prakoso
  • 51
  • 1
  • 4
0
votes
0 answers

Write rate of DAC MCP4725

I have a buffer which contains 16000 PCM samples of 8Khz 8-bit mono. I am trying to play it using 12 bit MCP4725 DAC. I have tried using micros() to control the write interval for the DAC. Here's my code - uint8_t soundData[16000] = {…
Ashish K
  • 905
  • 10
  • 27
0
votes
1 answer

when i encode pcm to an aac file,the file is not correctly analyzed with aac analysis tool

When the sample-rate is 44100,the aac byte array can be decoded and i can sound voice ,but others can not be decoded correctly.I don't know why? Before encode,i set the MediaFormat.the csd-0 is copy from other sample,and the MediaFormat param…
YLC
  • 11
  • 2
0
votes
0 answers

FFMPEG: Converting from raw audio to audio/mp4 (audio is being converted with slow speed)

If I convert from mp3 to mp4 directly everything works perfectly. But if I try to convert from raw pcm, the audio speed is slowed down. I've tried the following (this works): ffmpeg -i mp3/1.mp3 -strict -2 final.mp4 This doesn't work as…
Valdir
  • 495
  • 2
  • 7
  • 20
0
votes
0 answers

Why saving of 32-bit sample rate, PCM float byte[] to wav file creates distortion/crackling?

I have the following two function that loads any given WAV file into a byte array and gets the format (i.e. AudioFormat) of a given WAV file respectively: private byte[] getAudioData(String wavPath) throws IOException, UnsupportedAudioFileException…
Code Doggo
  • 2,146
  • 6
  • 33
  • 58
0
votes
0 answers

Is interrupt jitter causing the annoying wobble in audio using the mcu's dac?

I had a assignment for college where we needed to play a precompiled wav as integer array through the PWM and DAC. Now, I wanted more of a challenge, so I went out of my way and created a audio dac over usb using the micro controller in question:…
0
votes
0 answers

Batch amplification of PCM audio using sox

I have a large number of .PCM files (248 total) that are all encoded as: Encoding: Signed 16-bit uncompressed PCM Byte order: Little-endian Channels: 2 channel (stereo) Sample rate: 44100 Hz 8 Byte header I need to apply a -7.5 db amplification…
edale
  • 31
  • 3
0
votes
1 answer

Play PCM as it is being generated

I am generating some raw audio data in javascript and I need to play it as I am generating it. I searched for this here and the closest thing to what I am looking for is this. However, in the answer given there the array of data points is generated…
indjev99
  • 134
  • 1
  • 13