POV-Ray : Newsgroups : povray.off-topic : Data compression Server Time
30 Jul 2024 00:30:22 EDT (-0400)
  Data compression (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: Data compression
Date: 10 May 2011 15:15:18
Message: <4dc98ec6@news.povray.org>

> 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

From: Invisible
Subject: Re: Data compression
Date: 11 May 2011 04:04:49
Message: <4dca4321$1@news.povray.org>
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

From: Invisible
Subject: Re: Data compression
Date: 11 May 2011 04:06:48
Message: <4dca4398$1@news.povray.org>
>> 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

From: Le Forgeron
Subject: Re: Data compression
Date: 11 May 2011 04:27:09
Message: <4dca485d$1@news.povray.org>
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

From: Invisible
Subject: Re: Data compression
Date: 11 May 2011 04:36:28
Message: <4dca4a8c@news.povray.org>
>> 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

From: Le Forgeron
Subject: Re: Data compression
Date: 11 May 2011 08:21:04
Message: <4dca7f30$1@news.povray.org>
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

From: Invisible
Subject: Re: Data compression
Date: 11 May 2011 09:10:20
Message: <4dca8abc$1@news.povray.org>
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

From: Le Forgeron
Subject: Re: Data compression
Date: 11 May 2011 09:53:45
Message: <4dca94e9$1@news.povray.org>
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

From: Alain
Subject: Re: Data compression
Date: 11 May 2011 23:23:03
Message: <4dcb5297$1@news.povray.org>

> 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

From: Invisible
Subject: Re: Data compression
Date: 12 May 2011 04:02:50
Message: <4dcb942a$1@news.povray.org>
>> 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

<<< Previous 5 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.