1-Bit Wave File?

Page 2 - Seeking answers? Join the Tom's Guide community: where nearly two million members share solutions and discuss the latest tech.
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Geoff Wood wrote:
> Tachyon wrote:
>> On 2004-05-18, Geoff Wood <geoff@paf.co.nz-nospam> wrote:
>
>> Additionally, square and PWM waveforms, staples of much electronic
>> music, are 1-bit waveforms.
>
> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
>

On the other hand, I guess it does, but not a PWM signal that has any
relationship to the PCM-encoded waveform !

;-)

geoff
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Richard Crowley" <rcrowley7@xprt.net> wrote in message news:<10aola6pnbau090@corp.supernews.com>...
>
> Of course true "1-bit" audio is indistinguishable from
> random noise.
>

In a word, wrong. In two words, completely wrong.

A 1-bit stream is perfectly capable of holding quite intelligible
audio. It will have a broadband dynamic range of only 6 dB, but
that is quite enough for intelligible speech and easily recognizable
music.

You should maybe review works such as Lipshitz and Vanderkooy's
"Resolution below the least significant bit in audio systems with
dither" from JAES before making such a pronouncement.
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Me <secad@netspace.net.au> wrote in message news:<c8i3fp$1kpk$1@otis.netspace.net.au>...
> Curious wrote:
>
> > I am looking for audio software that allows conversion of 16-bit WAVs
> > and 8-bit WAVs to 1-bit WAVs. I have used Adobe Audition and CakeWalk
> > Pyro. Neither of them work. CakeWalk does have a "bit-depth converter"
> > as a FX, however, when I try to use it, I get a runtime error and
> > Cakewalk automatically closes.
>
> A + Comparator FlipFlop
> I/P -------|\ +------+ Q
> | >----------| D Q|---+---- Bitstream out
> B +--|/ C +--|> | |
> | - | +------+ |
> | | |
> +-/\/\/\-----)-------------+
> | R |
> C === |
> | Fs---+
> 0V
>
> Several years ago I made a delay line to delay the audio for a walkie-talkie
> so that the Tx VOX voice operated switch and Rx unmute operation would be
> completed before the leading word spoken by the operator was transmitted.
> I tried a bucket brigade device (MN3001) but had troubles with noise and
> limitations on maximum delay.
>
> I tried the cct above as a 1-bit encoder (mentioned in a mag somewhere),
> clocked at over 200KHz. I do not know if the cct has a name.
>

The above circuit looks to me very much like an implementation of a
delta modulator, the RC circuit being a lossy integrator. This is the
forunner to delta-sigma isn't it?

Paavo Jumppanen
Author of HarBal Harmonic Balancer
http://www.har-bal.com
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Dick Pierce wrote:

> "Richard Crowley" <rcrowley7@xprt.net> wrote in message news:<10aola6pnbau090@corp.supernews.com>...
>
>>Of course true "1-bit" audio is indistinguishable from
>>random noise.
>>
>
>
> In a word, wrong. In two words, completely wrong.
>
> A 1-bit stream is perfectly capable of holding quite intelligible
> audio. It will have a broadband dynamic range of only 6 dB, but
> that is quite enough for intelligible speech and easily recognizable
> music.

Please read the thread and don't try to justify balf-baked ideas. We all
know that data coming one bit at a time can be useful: this message will
be transmitted that way.

According to what he asked for, the OP wants to strip all but the sign
bit from a wave file in hopes of getting "that old movie sound".

> You should maybe review works such as Lipshitz and Vanderkooy's
> "Resolution below the least significant bit in audio systems with
> dither" from JAES before making such a pronouncement.

Why? It's irrelevant to this thread.

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Paavo Jumppanen wrote:

> Me <secad@netspace.net.au> wrote in message news:<c8i3fp$1kpk$1@otis.netspace.net.au>...
>
>>Curious wrote:
>>
>>
>>>I am looking for audio software that allows conversion of 16-bit WAVs
>>>and 8-bit WAVs to 1-bit WAVs. I have used Adobe Audition and CakeWalk
>>>Pyro. Neither of them work. CakeWalk does have a "bit-depth converter"
>>>as a FX, however, when I try to use it, I get a runtime error and
>>>Cakewalk automatically closes.
>>
>> A + Comparator FlipFlop
>>I/P -------|\ +------+ Q
>> | >----------| D Q|---+---- Bitstream out
>> B +--|/ C +--|> | |
>> | - | +------+ |
>> | | |
>> +-/\/\/\-----)-------------+
>> | R |
>> C === |
>> | Fs---+
>> 0V
>>
>>Several years ago I made a delay line to delay the audio for a walkie-talkie
>>so that the Tx VOX voice operated switch and Rx unmute operation would be
>>completed before the leading word spoken by the operator was transmitted.
>>I tried a bucket brigade device (MN3001) but had troubles with noise and
>>limitations on maximum delay.
>>
>>I tried the cct above as a 1-bit encoder (mentioned in a mag somewhere),
>>clocked at over 200KHz. I do not know if the cct has a name.
>>
>
>
> The above circuit looks to me very much like an implementation of a
> delta modulator, the RC circuit being a lossy integrator. This is the
> forunner to delta-sigma isn't it?
>
> Paavo Jumppanen
> Author of HarBal Harmonic Balancer
> http://www.har-bal.com

It looks to me as if the comparator will oscillate at a variable
frequency and a duty cycle such that the average DC in its output is the
same as the level at its input. The flip-flop merely quantizes the
transition times. It's effectively a Class D amplifier.

Jerry
--
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Randy Yates wrote:

>>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
>>>
>>
>> On the other hand, I guess it does,
>
> Absolutely it does not. A PWM signal has the property that at
> time n*T the signal begins at a high state for p*T seconds and
> ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
> bitstream does not have this property.
>
> Many people seem to have this misconception that a delta sigma
> bitstream is a PWM waveform. It is not - they are two different
> animals.

I was alluding to the resultant signal being an asymetrical bitstream, like
a PWM signal. Though I did qualify that it bears no relationship to any
encoded signal.

One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
me.

geoff
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Geoff Wood" <geoff@paf.co.nz-nospam> writes:

> Randy Yates wrote:
>
> >>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
> >>>
> >>
> >> On the other hand, I guess it does,
> >
> > Absolutely it does not. A PWM signal has the property that at
> > time n*T the signal begins at a high state for p*T seconds and
> > ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
> > bitstream does not have this property.
> >
> > Many people seem to have this misconception that a delta sigma
> > bitstream is a PWM waveform. It is not - they are two different
> > animals.
>
> I was alluding to the resultant signal being an asymetrical bitstream, like
> a PWM signal.

I have no idea what you mean.

> Though I did qualify that it bears no relationship to any
> encoded signal.

What is "it"?

> One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
> me.

How so? It doesn't match any definition of PWM that I know of. When I talk
about PWM, I mean, e.g., the type of signal shown in figure one of

http://www.embedded.com/story/OEG20010821S0096

--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

On Fri, 21 May 2004 08:40:43 +1200, "Geoff Wood"
<geoff@paf.co.nz-nospam> wrote:

>Randy Yates wrote:
>
>>>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
>>>>
>>>
>>> On the other hand, I guess it does,
>>
>> Absolutely it does not. A PWM signal has the property that at
>> time n*T the signal begins at a high state for p*T seconds and
>> ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
>> bitstream does not have this property.
>>
>> Many people seem to have this misconception that a delta sigma
>> bitstream is a PWM waveform. It is not - they are two different
>> animals.
>
>I was alluding to the resultant signal being an asymetrical bitstream, like
>a PWM signal. Though I did qualify that it bears no relationship to any
>encoded signal.
>
>One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
>me.
>
>geoff
>

Just to be sure - there are no digits in PWM - it is an analogies
system. It is sampled, to be sure, but not digitally.

d
Pearce Consulting
http://www.pearce.uk.com
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Randy Yates" <randy.yates@sonyericsson.com> wrote in message
news:xxp65aqg529.fsf@usrts005.corpusers.net...
> "Geoff Wood" <geoff@paf.co.nz-nospam> writes:
>
> > Randy Yates wrote:
> >
> > >>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
> > >>>
> > >>
> > >> On the other hand, I guess it does,
> > >
> > > Absolutely it does not. A PWM signal has the property that at
> > > time n*T the signal begins at a high state for p*T seconds and
> > > ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
> > > bitstream does not have this property.
> > >
> > > Many people seem to have this misconception that a delta sigma
> > > bitstream is a PWM waveform. It is not - they are two different
> > > animals.
> >
> > I was alluding to the resultant signal being an asymetrical bitstream, like
> > a PWM signal.
>
> I have no idea what you mean.
>
> > Though I did qualify that it bears no relationship to any
> > encoded signal.
>
> What is "it"?
>
> > One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
> > me.
>
> How so? It doesn't match any definition of PWM that I know of. When I talk
> about PWM, I mean, e.g., the type of signal shown in figure one of
>
> http://www.embedded.com/story/OEG20010821S0096


Randy,

I don't see any reason why you couldn't create the waveforms shown in Fig. 1
above with a 1-bit PCM waveform, assuming sufficient sample rate.

-Jon
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

On Thu, 20 May 2004 21:37:27 GMT, donald@pearce.uk.com (Don Pearce)
wrote:

>On Fri, 21 May 2004 08:40:43 +1200, "Geoff Wood"
><geoff@paf.co.nz-nospam> wrote:
>
>>Randy Yates wrote:
>>
>>>>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
>>>>>
>>>>
>>>> On the other hand, I guess it does,
>>>
>>> Absolutely it does not. A PWM signal has the property that at
>>> time n*T the signal begins at a high state for p*T seconds and
>>> ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
>>> bitstream does not have this property.
>>>
>>> Many people seem to have this misconception that a delta sigma
>>> bitstream is a PWM waveform. It is not - they are two different
>>> animals.
>>
>>I was alluding to the resultant signal being an asymetrical bitstream, like
>>a PWM signal. Though I did qualify that it bears no relationship to any
>>encoded signal.
>>
>>One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
>>me.
>>
>>geoff
>>
>
>Just to be sure - there are no digits in PWM - it is an analogies
>system. It is sampled, to be sure, but not digitally.
>
>d
>Pearce Consulting
>http://www.pearce.uk.com

Good old spell-checker! Make that "analogue".

d
Pearce Consulting
http://www.pearce.uk.com
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Jon Harris" <goldentully@hotmail.com> writes:

> "Randy Yates" <randy.yates@sonyericsson.com> wrote in message
> news:xxp65aqg529.fsf@usrts005.corpusers.net...
> > "Geoff Wood" <geoff@paf.co.nz-nospam> writes:
> >
> > > Randy Yates wrote:
> > >
> > > >>> Bit-depth reducing to 1 bit does not convert PCM into a PWM signal.
> > > >>>
> > > >>
> > > >> On the other hand, I guess it does,
> > > >
> > > > Absolutely it does not. A PWM signal has the property that at
> > > > time n*T the signal begins at a high state for p*T seconds and
> > > > ends at a low state for (1-p)*T seconds, 0 <= p <= 1. A 1-bit
> > > > bitstream does not have this property.
> > > >
> > > > Many people seem to have this misconception that a delta sigma
> > > > bitstream is a PWM waveform. It is not - they are two different
> > > > animals.
> > >
> > > I was alluding to the resultant signal being an asymetrical bitstream, like
> > > a PWM signal.
> >
> > I have no idea what you mean.
> >
> > > Though I did qualify that it bears no relationship to any
> > > encoded signal.
> >
> > What is "it"?
> >
> > > One "1", followed by one "0", then two "1"s followed by a "0" looks PWM to
> > > me.
> >
> > How so? It doesn't match any definition of PWM that I know of. When I talk
> > about PWM, I mean, e.g., the type of signal shown in figure one of
> >
> > http://www.embedded.com/story/OEG20010821S0096
>
>
> Randy,
>
> I don't see any reason why you couldn't create the waveforms shown in Fig. 1
> above with a 1-bit PCM waveform, assuming sufficient sample rate.

Jon,

I'm not saying you can't generate PWM digitally. Yes, I agree that you can.

I'm saying that when you requantize a multi-bit waveform to 1 bit
(just a simple requantization, like when you requantize from 24 bits
to 16 bits, but this time you go all the way down to 1 bit), the
result will NOT be a PWM signal.

I'm also saying that if you perform a delta sigma conversion of a
multi-bit waveform to a 1-bit waveform (i.e., perform a delta sigma
D/A conversion and examine the 1-bit bistream before it is converted
to analog), the result will NOT be a PWM signal.
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
 

Jim

Distinguished
Mar 31, 2004
730
0
18,930
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Randy Yates wrote:

>
> Without entering into the debate about Dick's response, let me say, Richard,
> that I think even a 1-bit, 44.1 kHz signal will not be PURELY noise-like.

It's been about 15 years ago but I once played around with something like
this. Don't remember all the exact details. But, start with a good quality
speech recording sampled at somewhere in the 10-20KHz range 8-bit signed
integers (or maybe it was 16 bit). Then filter out most of the low frequency
content - I think at this point most of the frequency content was in the
1-4KHz range (sounds very tinny but still understandable)), then quantized
down to one bit (set all but sign bit to zero) then apply a low pass filter to
smooth out the square waves. On playback the result was surprisingly good -
well at least as good as early sound recordings. It worked quite well for
speech but music sounded very strange.


> The noise will be high, but my intuition tells me you will be able to hear
> the signal (at least one that is at a high level) in the noise. Almost
> certainly one would be able to hear a full-scale sinewave in such noise.

Why would the scale of the sine wave make any difference or maybe I
misunderstand what you're saying.

-jim


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"jim" <"N0sp"@m.sjedging@mwt.net> wrote in message
news:40ae12c8_4@corp.newsgroups.com...
>
>
> Randy Yates wrote:
>
> > The noise will be high, but my intuition tells me you will be able to hear
> > the signal (at least one that is at a high level) in the noise. Almost
> > certainly one would be able to hear a full-scale sinewave in such noise.
>
> Why would the scale of the sine wave make any difference or maybe I
> misunderstand what you're saying.

It is simply a signal-to-noise ratio issue. Much noise is added by the
dithering/quantizing process. If the original signal is quite loud, it will
still be recognizable above the noise floor. If it is very low level, it will
be further buried by the noise. I did a quick experiment, and a full scale
sinewave quanitzed with dither was easily heard. I decreased the level and
somewhere around 20-30dB down, you really start to lose it. I was actually
suprised by how low you could go and still make out the tone in the noise.
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Robert Gault" <robert.gault@worldnet.att.net> wrote in message
news:%Y1rc.8040$fF3.196740@bgtnsc05-news.ops.worldnet.att.net...
> Curious wrote:
>
> > Randy Yates <yates@ieee.org> wrote in message
news:<u0yfes12.fsf@ieee.org>...
> >
> > I want film-quality sound. By "film quality" I am referring to the
> > crackling [resembles the sound of burning coal] and lack of clarity in
> > the audio recordings of old B&W films which used the
> > variable-intensity recording. I would like to preserve the frequency
> > response of CD-audio [keep the 44.1 KHz sampling rate], however, I
> > would like to make it mono and film-quality in terms of the artifacts
> > mentioned above. For some reason this type of music gets my juices
> > going.
>
> You may be able to get this effect with a program like CoolEditPro which
> can merge a wide variety of distortion effects into your original sound.
> One of the built-in distortion settings may produce the type of sound
> you are after or you can create your own distortion.
>
> If you own one of these noisy films, record the sound from a section of
> film that has mostly noise and no audio. A program like CoolEditPro can
> extract the noise from the film section and merge it into any other
> sound file you have.

I think this is the right approach. This type of film noise is bursty, not like
quantization noise. I would probably add some low level pink noise to increase
the noise floor (easier than quantizing) and then find/create a suitable
"crackly" sound file to mix in. This file could be looped as necessary if it
wasn't as long as the sound track.
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Richard Crowley" <rcrowley7@xprt.net> writes:

> "TonyP" <TonyP@optus.net.com.au> wrote in message
> news:40adc228$0$1584$afc38c87@news.optusnet.com.au...
>>
>> "Jerry Avins" <jya@ieee.org> wrote in message
>> news:40ad4ecf$0$3106$61fed72c@news.rcn.com...
>> > Dick Pierce wrote:
>> > > "Richard Crowley" <rcrowley7@xprt.net> wrote in message
>> news:<10aola6pnbau090@corp.supernews.com>...
>> > >>Of course true "1-bit" audio is indistinguishable from
>> > >>random noise.
>> > > In a word, wrong. In two words, completely wrong.
>> > > A 1-bit stream is perfectly capable of holding quite intelligible
>> > > audio. It will have a broadband dynamic range of only 6 dB, but
>> > > that is quite enough for intelligible speech and easily recognizable
>> > > music.
>>
>> > Please read the thread and don't try to justify balf-baked ideas.
>>
>> Nothing half baked about Dicks ideas!
>>
>> > > You should maybe review works such as Lipshitz and Vanderkooy's
>> > > "Resolution below the least significant bit in audio systems with
>> > > dither" from JAES before making such a pronouncement.
>>
>> > Why? It's irrelevant to this thread.
>>
>> Dick specifically responded to Richards incorrect statement. Your post is
>> irrelevant to that.
>
> My statement was not incorrect. If you go back and read
> the OP's theory, he wanted to reduce NORMAL SAMPLING
> RATE (i.e. 44-48K) streams to very low (i.e. 1) bit depth.
>
> I still maintain that a 44 or 48K by 1-bit stream is virtually
> indistinguishable from noise.

Without entering into the debate about Dick's response, let me say, Richard,
that I think even a 1-bit, 44.1 kHz signal will not be PURELY noise-like.
The noise will be high, but my intuition tells me you will be able to hear
the signal (at least one that is at a high level) in the noise. Almost
certainly one would be able to hear a full-scale sinewave in such noise.
--
% Randy Yates % "My Shangri-la has gone away, fading like
%% Fuquay-Varina, NC % the Beatles on 'Hey Jude'"
%%% 919-577-9882 %
%%%% <yates@ieee.org> % 'Shangri-La', *A New World Record*, ELO
http://home.earthlink.net/~yatescr
 

Jim

Distinguished
Mar 31, 2004
730
0
18,930
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Jon Harris wrote:
>

>
> It is simply a signal-to-noise ratio issue. Much noise is added by the
> dithering/quantizing process. If the original signal is quite loud, it will
> still be recognizable above the noise floor. If it is very low level, it will
> be further buried by the noise. I did a quick experiment, and a full scale
> sinewave quanitzed with dither was easily heard. I decreased the level and
> somewhere around 20-30dB down, you really start to lose it. I was actually
> suprised by how low you could go and still make out the tone in the noise.

Well that was the point I was making in general there isn't going to be any
significant difference between fullscale and halfscale, for example. No
difference at all if they both have the same SNR.
I'm also not so sure that dithering helps any when you reduce the bit depth
below 2 bits. But maybe I just don't know the _proper_ way to dither when
going down to 1 bit.

-jim


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

jim <"N0sp"@m.sjedging@mwt.net> writes:
> [...]
> Why would the scale of the sine wave make any difference or maybe I
> misunderstand what you're saying.

Simple - signal-to-noise ratio. The higher the sine wave (up to
FS clipping) the higher the signal power and the better the SNR.
If you use dither, I would think, even with only 1 bit, you could
hear a sine wave at lower levels than FS, but FS would almost
definitely be audible.

Wait - I'll try it...

Yep, you can hear a FS sine wave just fine - boomin'! A Chopin
piano piece came through lovely too, just with a bunch of noise.

Here are the Matlab scripts in case you want to try this at home:

% Modify as required
[chopin,Fs,N] = wavread('~/wav/chopin');
wavwrite(quantize(chopin,1,1),Fs, N, 'chopinq');

quantize.m
----------
function y = quantize(x,N,ditherBool)
%function y = quantize(x,N,dBool)
% FUNCTION: N-bit Dithered Quantizer
% AUTHOR: Randy Yates
% DATE: 05-21-2004
% PARAMETERS:
% x = real input vector to be quantized, in the range -1 to +1.
% N = number of bits
% ditherBool
% 0 = do NOT dither
% 1 = add TPDF dither of appropriate amplitude to x before quantizing
% DESCRIPTION:
% This function takes the input x and quantizes it N bits.
% Both the input and output will be in the range -1 to +1.

% generate dither
d = ditherBool*(rand(size(x)) + rand(size(x)) - 1);
x1 = x*2^(N-1) + 2^(N-1) - 1/2;
x2 = clip(x1+d,-0.5+20*eps,2^N - 1 - 20*eps);
x2 = round(x2);
x3 = x2* (2/(2^N - 1)) - 1;
y = x3;


clip.m
------
function y = clip(x, Mmin, Mmax)
%function y = clip(x, min, max)
% FUNCTION: clip
% AUTHOR: Randy Yates
% DATE: 05-21-2004
% PARAMETERS:
% x = real input vector to be clipped
% Mmin = lower clip level
% Mmax = upper clip level
% DESCRIPTION:
% The input will be clipped so that Mmin <= y <= Mmax

y = min(x,Mmax);
y = max(y,Mmin);


--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

jim <"N0sp"@m.sjedging@mwt.net> writes:

> Jon Harris wrote:
> >
>
> >
> > It is simply a signal-to-noise ratio issue. Much noise is added by the
> > dithering/quantizing process. If the original signal is quite loud, it will
> > still be recognizable above the noise floor. If it is very low level, it will
> > be further buried by the noise. I did a quick experiment, and a full scale
> > sinewave quanitzed with dither was easily heard. I decreased the level and
> > somewhere around 20-30dB down, you really start to lose it. I was actually
> > suprised by how low you could go and still make out the tone in the noise.
>
> Well that was the point I was making in general there isn't going to be any
> significant difference between fullscale and halfscale, for example. No
> difference at all if they both have the same SNR.

They *WON'T* have the same SNR. THAT'S THE POINT!

> I'm also not so sure that dithering helps any when you reduce the bit depth
> below 2 bits.

The coarser the quantizer, the more dither helps, all the way down to 1 bit!

> But maybe I just don't know the _proper_ way to dither when
> going down to 1 bit.

Same way as for N bits. The dither level for N bits is a function of N, just
set N = 1.
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

"Randy Yates" <randy.yates@sonyericsson.com> wrote in message
news:xxpisepcyg7.fsf@usrts005.corpusers.net...
> jim <"N0sp"@m.sjedging@mwt.net> writes:
>
> > Jon Harris wrote:
> > >
> > > It is simply a signal-to-noise ratio issue. Much noise is added by the
> > > dithering/quantizing process. If the original signal is quite loud, it
will
> > > still be recognizable above the noise floor. If it is very low level, it
will
> > > be further buried by the noise. I did a quick experiment, and a full
scale
> > > sinewave quanitzed with dither was easily heard. I decreased the level
and
> > > somewhere around 20-30dB down, you really start to lose it. I was
actually
> > > suprised by how low you could go and still make out the tone in the noise.
> >
> > Well that was the point I was making in general there isn't going to be any
> > significant difference between fullscale and halfscale, for example. No
> > difference at all if they both have the same SNR.
>
> They *WON'T* have the same SNR. THAT'S THE POINT!

Right! Halfscale with have 6dB less SNR than full-scale.
 
G

Guest

Guest
Archived from groups: rec.audio.tech,comp.dsp (More info?)

Thanks for posting Randy. FYI, I accomplished a similar thing using CoolEdit.
I first reduced the gain by 90dB, making sure the Dither option was checked in
preferences. Then I normalized the file to boost the level to where I could
easily hear it. It's not strictly 1-bit, because you end up with 3 levels
(-full scale, zero, +full scale), so it's more than 1.5 bit. But it
illustrates the general effect quite nicely.

"Randy Yates" <randy.yates@sonyericsson.com> wrote in message
news:xxpn041cyuf.fsf@usrts005.corpusers.net...
> Wait - I'll try it...
>
> Yep, you can hear a FS sine wave just fine - boomin'! A Chopin
> piano piece came through lovely too, just with a bunch of noise.
>
> Here are the Matlab scripts in case you want to try this at home:
>
> % Modify as required
> [chopin,Fs,N] = wavread('~/wav/chopin');
> wavwrite(quantize(chopin,1,1),Fs, N, 'chopinq');
>
> quantize.m
> ----------
> function y = quantize(x,N,ditherBool)
> %function y = quantize(x,N,dBool)
> % FUNCTION: N-bit Dithered Quantizer
> % AUTHOR: Randy Yates
> % DATE: 05-21-2004
> % PARAMETERS:
> % x = real input vector to be quantized, in the range -1 to +1.
> % N = number of bits
> % ditherBool
> % 0 = do NOT dither
> % 1 = add TPDF dither of appropriate amplitude to x before quantizing
> % DESCRIPTION:
> % This function takes the input x and quantizes it N bits.
> % Both the input and output will be in the range -1 to +1.
>
> % generate dither
> d = ditherBool*(rand(size(x)) + rand(size(x)) - 1);
> x1 = x*2^(N-1) + 2^(N-1) - 1/2;
> x2 = clip(x1+d,-0.5+20*eps,2^N - 1 - 20*eps);
> x2 = round(x2);
> x3 = x2* (2/(2^N - 1)) - 1;
> y = x3;
>
>
> clip.m
> ------
> function y = clip(x, Mmin, Mmax)
> %function y = clip(x, min, max)
> % FUNCTION: clip
> % AUTHOR: Randy Yates
> % DATE: 05-21-2004
> % PARAMETERS:
> % x = real input vector to be clipped
> % Mmin = lower clip level
> % Mmax = upper clip level
> % DESCRIPTION:
> % The input will be clipped so that Mmin <= y <= Mmax
>
> y = min(x,Mmax);
> y = max(y,Mmin);
 

TRENDING THREADS