 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I've got a CD at home. When I first got it, I noticed that certain
passages sound very slightly strange. Today, ten years later, I know
exactly what it sounds like: it sounds like lossy audio compression.
This raises two interesting questions:
1. Why the hell would you put compressed audio onto a CD rather than the
uncompressed original source?
2. If I can tell that it's compressed, despite not having the
uncompressed original to compare to, doesn't that mean that there's more
redundancy in the signal than the codec is taking advantage of?
Now I don't actually know which codec was used here. [Asking whether you
can tell the codec by the compression artefacts is another interesting
question.] But in this instance, there are long echo tails which are
getting audibly chewed up. Not drastically so, but enough to be noticeable.
The only audio codecs I've looked at seem to work exclusively in the
frequency domain. The general algorithm seems to be
- Chop the signal into chunks.
- Apply some Fourier-based transform to each chunk, taking it into the
frequency domain.
- Use a psychoacoustic model to priorities each element of the spectrum.
- Adjust the resolution of each spectrum sample in proportion to
priorities and available bandwidth.
- Encode each spectrum sample with the requisite number of bits.
- Apply an entropy coder to cram the results into the smallest available
space.
All of this makes no use whatsoever of the striking similarity between
consecutive audio chunks. That's the equivalent of a video codec which
encodes each individual frame completely separately, without reference
to the previous frames. (I really hope no serious video codes do this!)
This disregard for temporal redundancy is presumably why I can tell the
difference between compressed and uncompressed audio, even with no
reference to compare to. Interestingly, this /also/ suggests that it
might perhaps be possible to /recover/ the lost information. I mean, if
I can tell it's gone, perhaps it's possible to deduce what it was?
Perhaps a more interesting question is "how can we make a better codec?"
My personal feeling would be to split the audio into many narrow-band
signals, map the amplitude curve of each one, and store a compressed
description of these curves.
Now I just need to go implement that... HA! o_O
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5/10/2011 8:32, Invisible wrote:
> 1. Why the hell would you put compressed audio onto a CD rather than the
> uncompressed original source?
Because you don't have the original source, or the person mastering the CD
got the original source over a network and didn't want to spend the
bandwidth and didn't care?
There are lots of CDs out there that were copied off vinyl albums that
weren't properly compensated and have the treble turned way up. (Vinyl turns
the treble up, and the record player turns it back down, to reduce hiss.)
Tomita's "Pictures at an Exhibition" has several tracks where they put the
same audio on both the left and right channel, just because they screwed up.
> 2. If I can tell that it's compressed, despite not having the uncompressed
> original to compare to, doesn't that mean that there's more redundancy in
> the signal than the codec is taking advantage of?
No. You can tell someone is talking over a telephone by the fact that too
much information is lost. Same with autotune.
> Now I don't actually know which codec was used here. [Asking whether you can
> tell the codec by the compression artefacts is another interesting
> question.] But in this instance, there are long echo tails which are getting
> audibly chewed up. Not drastically so, but enough to be noticeable.
Sounds like nyquist limits screwing up the codec, to me.
--
Darren New, San Diego CA, USA (PST)
"Coding without comments is like
driving without turn signals."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 10/05/2011 05:23 PM, Darren New wrote:
> On 5/10/2011 8:32, Invisible wrote:
>> 1. Why the hell would you put compressed audio onto a CD rather than the
>> uncompressed original source?
>
> Because you don't have the original source, or the person mastering the
> CD got the original source over a network and didn't want to spend the
> bandwidth and didn't care?
I can only imaging it was the latter. This particular CD is modern
electronic dance music, after all.
> There are lots of CDs out there that were copied off vinyl albums that
> weren't properly compensated and have the treble turned way up. (Vinyl
> turns the treble up, and the record player turns it back down, to reduce
> hiss.)
The other day, I was listening to a CD of vintage music, and a suddenly
noticed that most of it is monophonic. Imagine that! ;-)
>> 2. If I can tell that it's compressed, despite not having the
>> uncompressed
>> original to compare to, doesn't that mean that there's more redundancy in
>> the signal than the codec is taking advantage of?
>
> No. You can tell someone is talking over a telephone by the fact that
> too much information is lost. Same with autotune.
You can't tell that information has been lost unless you can tell that
it was there in the first place. And if you can tell there's something
missing just by looking at what's still there, there's redundancy.
>> Now I don't actually know which codec was used here. [Asking whether
>> you can
>> tell the codec by the compression artefacts is another interesting
>> question.] But in this instance, there are long echo tails which are
>> getting
>> audibly chewed up. Not drastically so, but enough to be noticeable.
>
> Sounds like nyquist limits screwing up the codec, to me.
Take any piece of sound. Apply too much MP3 compression. You can hear
the quantinisation steps in the signal levels.
This isn't that bad, of course. You have to listen fairly hard to hear
it. Then again, I'm the sort of person who owns a £100 set of headphones
and a £300 CD player, so...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 5/10/2011 10:13, Orchid XP v8 wrote:
> I can only imaging it was the latter. This particular CD is modern
> electronic dance music, after all.
Yeah, I usually encounter it on albums that were old on vinyl. :-)
> You can't tell that information has been lost unless you can tell that
it
> was there in the first place. And if you can tell there's something mis
sing
> just by looking at what's still there, there's redundancy.
Except you can compare to that which you've heard elsewhere. Have you eve
r
heard someone do a call-in phone interview on the radio? Could you tell t
he
difference between the DJ's voice and the phoned-in voice, even though yo
u
might never have heard either before? It's because you know what tonal
ranges you should be hearing.
You can tell an over-compressed violin because you're comparing it to oth
er,
uncompressed violins in your memory. Even if there's no redundancy left.
Indeed, why do you not think you're hearing a lack of redundancy?
> Take any piece of sound. Apply too much MP3 compression. You can hear t
he
> quantinisation steps in the signal levels.
OK.
> This isn't that bad, of course. You have to listen fairly hard to hear
it.
> Then again, I'm the sort of person who owns a £100 set of headphon
es and a
> £300 CD player, so...
Yep.
--
Darren New, San Diego CA, USA (PST)
"Coding without comments is like
driving without turn signals."
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> On 5/10/2011 8:32, Invisible wrote:
> > 1. Why the hell would you put compressed audio onto a CD rather than the
> > uncompressed original source?
> Because you don't have the original source, or the person mastering the CD
> got the original source over a network and didn't want to spend the
> bandwidth and didn't care?
It becomes even worse when executives demand the audio to be amplified
ten-fold due to the loudness war.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2011/05/10 11:32, Invisible a écrit :
> I've got a CD at home. When I first got it, I noticed that certain
> passages sound very slightly strange. Today, ten years later, I know
> exactly what it sounds like: it sounds like lossy audio compression.
>
> This raises two interesting questions:
>
> 1. Why the hell would you put compressed audio onto a CD rather than the
> uncompressed original source?
Maybe that the original recording was done in a lossy format, or even a
non-lossy format but with a sample rate set to low and a sample
resolution also to low... Like 4000 kHz (or even less), 4 bits...
(I had a single CD that contained the whole Beatles discography encoded
as .wav at that level or about...)
>
> 2. If I can tell that it's compressed, despite not having the
> uncompressed original to compare to, doesn't that mean that there's more
> redundancy in the signal than the codec is taking advantage of?
It's just that you have reasons to expect a higher chromatic range than
the one you have.
If it sound like speech but misses the harmonics that are normaly
present and expected, it will sound suspicious or strange.
Same thing for any known musical instrument's sounds.
If there is some sampling of previously heard peices, you also can
perceive the lacking parts.
>
> Now I don't actually know which codec was used here. [Asking whether you
> can tell the codec by the compression artefacts is another interesting
> question.] But in this instance, there are long echo tails which are
> getting audibly chewed up. Not drastically so, but enough to be noticeable.
Even the best codec set at the highest quality can't do miracle if the
source is bad...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 10/05/2011 20:15, Alain wrote:
> Maybe that the original recording was done in a lossy format, or even a
> non-lossy format but with a sample rate set to low and a sample
> resolution also to low... Like 4000 kHz (or even less), 4 bits...
> (I had a single CD that contained the whole Beatles discography encoded
> as .wav at that level or about...)
A normal CD is 40 kHz, so 4000 kHz would be 10x *higher* resolution than
normal. And 4 bits per sample would be almost unrecognisable.
>> 2. If I can tell that it's compressed, despite not having the
>> uncompressed original to compare to, doesn't that mean that there's more
>> redundancy in the signal than the codec is taking advantage of?
>
> It's just that you have reasons to expect a higher chromatic range than
> the one you have.
Chromatic range? I think perhaps you meant dynamic range.
> Even the best codec set at the highest quality can't do miracle if the
> source is bad...
In this case, that's unlikely to be the problem.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> You can't tell that information has been lost unless you can tell that it
>> was there in the first place. And if you can tell there's something
>> missing
>> just by looking at what's still there, there's redundancy.
>
> Except you can compare to that which you've heard elsewhere. Have you
> ever heard someone do a call-in phone interview on the radio? Could you
> tell the difference between the DJ's voice and the phoned-in voice, even
> though you might never have heard either before? It's because you know
> what tonal ranges you should be hearing.
>
> You can tell an over-compressed violin because you're comparing it to
> other, uncompressed violins in your memory. Even if there's no
> redundancy left. Indeed, why do you not think you're hearing a lack of
> redundancy?
Like I said, I can hear glitches in various quiet echo trails. The sound
should die away smoothly, but instead it's stepping. The codec is
apparently ignoring temporal redundancy.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 11/05/2011 10:04, Invisible a écrit :
> On 10/05/2011 20:15, Alain wrote:
>
>> Maybe that the original recording was done in a lossy format, or even a
>> non-lossy format but with a sample rate set to low and a sample
>> resolution also to low... Like 4000 kHz (or even less), 4 bits...
>> (I had a single CD that contained the whole Beatles discography encoded
>> as .wav at that level or about...)
>
> A normal CD is 40 kHz, so 4000 kHz would be 10x *higher* resolution than
> normal. And 4 bits per sample would be almost unrecognisable.
CD is 44.1kHz, dual channel, 16 bits per sample (linear PCM).
I guess Alain was thinking of a recording at 4000 Hz.
4 bits sampling does in fact exist, but not in CD format, rather as
adaptative delta encoding (I used to have such hardware which could
record & play sound using only 4 bits per sample. All the smart was in
the chip)
Transforming a capture into a CD-style wav file is something I never
succeed to achieve.
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> A normal CD is 40 kHz, so 4000 kHz would be 10x *higher* resolution than
>> normal. And 4 bits per sample would be almost unrecognisable.
>
> CD is 44.1kHz, dual channel, 16 bits per sample (linear PCM).
>
> I guess Alain was thinking of a recording at 4000 Hz.
Which would put the Nyquist limit at a piffling 2000 Hz. Even POTS
manages better bandwidth than that. Note that 2000 Hz is roughly 2
octaves above middle C. And that's only the fundamental frequency,
ignoring all the harmonics. Note also that the human voice runs well
outside that range as well.
> 4 bits sampling does in fact exist
Indeed. It depends on what you're trying to sample. Some applications
might not need high spatial resolution. Others might not need high
temporal resolution. For example, we sample the output of our mass
spectrometers at about 4 Hz. The signal changes so slowly that there's
really no need to sample any faster.
I would suggest, however, that 4 bits/sample would be inadequate for
audio applications.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 11/05/2011 10:36, Invisible a écrit :
>
> I would suggest, however, that 4 bits/sample would be inadequate for
> audio applications.
For a linear PCM, yes.
But one of the latest format (SACD) use only 1 bit/sample (at a silly
high sampling rate) in a non-PCM storage.
(in fact the bit is simply a up/down delta, and it make easy to get ride
of the digital to analogue converter in the mass production of player:
use the bit to drive digitally a transistor, accumulate output in a
capacitor, the connection to the ear-set is done directly on the
capacitor (volume is set by resistor on the transistor's upstream))
2 cheap components (or even less if you can fake the capacitor with
circuitry) to replace an expensive DAC.
Delta Sigma encoding is really painful to convert back accurately in PCM.
And it is even worse with Adaptive Delta Sigma (where the unit of the
current sample is dependent of the previous samples), but they requires
far less bits than PCM.
(Adaptive Delta Sigma need more than 1 bit)
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 11/05/2011 13:21, Le_Forgeron wrote:
> Le 11/05/2011 10:36, Invisible a écrit :
>>
>> I would suggest, however, that 4 bits/sample would be inadequate for
>> audio applications.
>
> For a linear PCM, yes.
Linear PCM is the standard way to describe digital sound signals.
I should think that even logarithmic PCM would sound poor at 4 bits/sample.
> But one of the latest format (SACD) use only 1 bit/sample (at a silly
> high sampling rate) in a non-PCM storage.
You mean pulse density modulation.
> (in fact the bit is simply a up/down delta, and it make easy to get ride
> of the digital to analogue converter in the mass production of player:
> use the bit to drive digitally a transistor, accumulate output in a
> capacitor, the connection to the ear-set is done directly on the
> capacitor (volume is set by resistor on the transistor's upstream))
> 2 cheap components (or even less if you can fake the capacitor with
> circuitry) to replace an expensive DAC.
I'm not sure whether this is true.
I was also unable to discover what encoding SACD uses for its data. I
rather doubt that raw PDM written directly to the disc surface, any more
than a normal CD contains raw PCM.
> Delta Sigma encoding is really painful to convert back accurately in PCM.
Actually it's trivial. You just need a digital low-pass filter.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 11/05/2011 15:10, Invisible a écrit :
> On 11/05/2011 13:21, Le_Forgeron wrote:
>> Le 11/05/2011 10:36, Invisible a écrit :
>>>
>>> I would suggest, however, that 4 bits/sample would be inadequate for
>>> audio applications.
>>
>> For a linear PCM, yes.
>
> Linear PCM is the standard way to describe digital sound signals.
>
> I should think that even logarithmic PCM would sound poor at 4 bits/sample.
>
>> But one of the latest format (SACD) use only 1 bit/sample (at a silly
>> high sampling rate) in a non-PCM storage.
>
> You mean pulse density modulation.
You can call it like you want. It's a Delta Sigma encoding on 1 bit at
2.8+ MHz: to replay it, you just have to integrate (sigma).
>
>> (in fact the bit is simply a up/down delta, and it make easy to get ride
>> of the digital to analogue converter in the mass production of player:
>> use the bit to drive digitally a transistor, accumulate output in a
>> capacitor, the connection to the ear-set is done directly on the
>> capacitor (volume is set by resistor on the transistor's upstream))
>> 2 cheap components (or even less if you can fake the capacitor with
>> circuitry) to replace an expensive DAC.
>
> I'm not sure whether this is true.
It is. At least, it is possible.
>
> I was also unable to discover what encoding SACD uses for its data. I
> rather doubt that raw PDM written directly to the disc surface, any more
> than a normal CD contains raw PCM.
Raw, no. You need a container for specifying the data rate, the mixing
of the channels. And at lower layer, a bit of self-correcting error
detection encoding (just like the 512/4096 sectors of harddrive are in
fact a bit more bits on the medium, usually with a 8/14 encoding and
some CRC.
A bit like movie containers: the streams must be identified, and
multiplexed. Once separated, each stream can be pushed to its own decoder.
And IIRC, SACD likes to play with DRM (which means a bit of encryption:
the key for the disc is on the disc, but only readable by licensed SACD
device.)
>
>> Delta Sigma encoding is really painful to convert back accurately in PCM.
>
> Actually it's trivial. You just need a digital low-pass filter.
The issue is computing the right parameters of the filter and
*accurately*. (If many PCM to/from SACD encoding+decoding was performed
in sequences, some difference might appears between the various PCM
stages... ). Fine tuning that part was really out of my capability.
--
Software is like dirt - it costs time and money to change it and move it
around.<br/><br/>
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2011/05/11 04:04, Invisible a écrit :
> On 10/05/2011 20:15, Alain wrote:
>
>> Maybe that the original recording was done in a lossy format, or even a
>> non-lossy format but with a sample rate set to low and a sample
>> resolution also to low... Like 4000 kHz (or even less), 4 bits...
>> (I had a single CD that contained the whole Beatles discography encoded
>> as .wav at that level or about...)
>
> A normal CD is 40 kHz, so 4000 kHz would be 10x *higher* resolution than
> normal. And 4 bits per sample would be almost unrecognisable.
I missed the decimal point.
When I got that CD, I was realy surprised that they managed to cram so
many tracks on it. I looked attentively at the files and their
formating. I was rather incredulous at the 4 bits, but after checking
with another programm, the result was the same.
And the sound was very surprisingly good.
>
>>> 2. If I can tell that it's compressed, despite not having the
>>> uncompressed original to compare to, doesn't that mean that there's more
>>> redundancy in the signal than the codec is taking advantage of?
>>
>> It's just that you have reasons to expect a higher chromatic range than
>> the one you have.
>
> Chromatic range? I think perhaps you meant dynamic range.
Dynamic range is about the range from low volume to high, chromatic
range is about the low to high frequency, in particular, the fidelity of
the harmonics.
At least, according to the texts that I have read over over 40 years...
>
>> Even the best codec set at the highest quality can't do miracle if the
>> source is bad...
>
> In this case, that's unlikely to be the problem.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> Chromatic range? I think perhaps you meant dynamic range.
>
> Dynamic range is about the range from low volume to high, chromatic
> range is about the low to high frequency, in particular, the fidelity of
> the harmonics.
> At least, according to the texts that I have read over over 40 years...
"Chromatic" usually refers to musical notes, not sonic frequencies. The
term more usually applied to the range of frequencies that something
supports is "bandwidth".
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |