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

Extract left channel PCM data from MPG123 output

I'm using the MPG123 library to decode MP3s to PCM data. I want to apply a FFT to the PCM data, specifically the left channel's. The mpg123_read function populates a char array with the PCM data. How can I extract the left channel's PCM data from…
Kevin
  • 45
  • 6
0
votes
0 answers

Recording in stereo with pyalsaaudio

I am attempting to record in stereo using a pair of stereo headphones, this Stereo USB soundcard: http://www.ebay.co.uk/itm/261343188737?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649 and my laptop. I am using the USB soundcard as I eventually…
0
votes
1 answer

Frequency : Decibel plot using FFT in MATLAB

I am trying to use MATLAB to import a WAV file and create the type of diagram shown below. I am basically trying to pull frequency information and plot it according to decibels. Here is the code I am working with, but it doesn't seem to pull the…
user1239087
0
votes
1 answer

How to play two sine wave on left and right channel separately with 16-bit format?

I need to generate 2 sine wave tones with different frequency and play them separately into right and left channel in stereo mode on Android. This is my code: int sample; double sampleRate; double duration; double time; double f1; double…
0
votes
2 answers

C++ - FFmpeg AAC-Decoding

I want to decode some audio streams in the format aac. I already found an example of MP3 and MP2 decoding here: http://ffmpeg.org/doxygen/trunk/decoding__encoding_8c-source.html at line 236. But this code doesn't work for files in the format aac. I…
user2492388
  • 151
  • 6
  • 15
0
votes
1 answer

Decode MP3 into PCM using JLayer to detect amplitude

Background: I am using JLayer to play an MP3 file. I am attempting to analyze the varying amplitude/audio levels in the MP3. With my analysis, I would like to determine the duration of the silence at the beginning and end of the MP3. In addition, as…
noahnu
  • 3,479
  • 2
  • 18
  • 40
0
votes
1 answer

How can I convert an audio channel inside an AVAssetTrack to PCM?

I'm trying to build an MTAudioProcessingTap that remixes the surround track of a video file. In order for that to work, I need to be able to convert each channel to PCM no matter what the source format is. Do you guys know how can I identify each…
awfulcode
  • 597
  • 5
  • 12
0
votes
1 answer

Configuring softvol in ALSA

I have a problem with a USB Sound Card: I cannot change the volume with alsamixer. I created a file called .asoundrc in order to create softvolume control. I made a mess because the default device is just for playback, and now have 3 controls:…
Mr_LinDowsMac
  • 2,644
  • 9
  • 56
  • 75
0
votes
1 answer

Convert audio Linear pcm to mp3 ( using LAME ) Low ,Medium,High audio Quality setting

I am encoding a LinearPCM to MP3 in iOS.I'm trying to encode the raw PCM data from microphone to MP3 using AudioToolbox framework and Lame.And although everything seems to run fine if i record an audio it is converted to mp3 with the help of lame…
Ravindhiran
  • 5,304
  • 9
  • 50
  • 82
0
votes
1 answer

PCM Data format with fmod - difference on multiple paltforms

I am writing a Unity3D plugin that reads data from an MP3 file, feeds the PCM data to Unity so that it can play it inside the engine. On iOS, I use the AVAssetReaderAudioMixOutput class to decode and read the data, and on Android/Windows, I use…
David Menard
  • 2,261
  • 3
  • 43
  • 67
0
votes
0 answers

How to trim PCM data to identify sample count or frame count to feed?

I want to feed libsamplerate (a library to downsample audio data which needs the following struct filled: typedef struct { float *data_in, *data_out ; long input_frames, output_frames ; long input_frames_used, output_frames_gen…
frankish
  • 6,738
  • 9
  • 49
  • 100
0
votes
1 answer

Using ALSA, how to record with a microphone what it is just playing out through a speaker?

I am trying to record what it is just playing out to the speaker using following ALSA APIs: snd_pcm_mmap_writei() snd_pcm_mmap_readi() Both functions are called one to next in the same thread. The writei() function returns quickly (I believe it…
0
votes
1 answer

Am I translating this C code to AS3 properly?

So I found some C code to decompress certain PCM samples, and I want to do the same in AS3. I have tried to do so, but it doesn't seem to be working. I know little to no C, although I'm quite fluent in AS3, so I might be translating it…
puggsoy
  • 1,270
  • 1
  • 11
  • 34
0
votes
4 answers

Converting audio samples into an audible file format

I've been trying to convert a huge amount of data (about 900 MB) to an audible file format for a few days now. I've been given a .dat file containing 900 millions floating-point samples (one per line) representing 90 seconds of music at 10 MHz. I…
mr_hyde
  • 505
  • 1
  • 6
  • 11
0
votes
1 answer

How to get PCM data from recorded sound for Fourier analysis

I've been working on c++ code that will take in sound and output it's core frequency, like a guitar tuner. I can generate my own randomized sine wave and successfully perform the FFT from a text file that is just amplitude vs. time. I just don't…