Hi there, where can I find info about headroom and clipping on Pd. Or can anyone tell me quickly how it goes?
Does it always really clip over a maximum of 1, or is there some headroom? Does it depend on the audiocard or something?
thanks
On 2013-12-20 16:55, Alexandre Torres Porres wrote:
Hi there, where can I find info about headroom and clipping on Pd. Or can anyone tell me quickly how it goes?
Does it always really clip over a maximum of 1, or is there some headroom? Does it depend on the audiocard or something?
The soundcard will always clip above +1 and below -1, and sometimes even within those limits (if the interpolated waveform between samples goes over the limit). Pd will not clip internally, so you can calculate with larger numbers as long as you scale them back down before listening to them.
Martin
On 2013-12-20 23:34, Martin Peach wrote:
On 2013-12-20 16:55, Alexandre Torres Porres wrote:
Hi there, where can I find info about headroom and clipping on Pd. Or can anyone tell me quickly how it goes?
Does it always really clip over a maximum of 1, or is there some headroom? Does it depend on the audiocard or something?
The soundcard will always clip above +1 and below -1, and sometimes even
yes, but the output of Pd (what you send to [dac~]) is not necessarily sent directly to the soundcard: e.g when using jack, the samples will be passed as floating point values to the next client: so samples exceeding -1..+1 need not clip at all. you can confirm this by connecting the output of Pd to the input of Pd via jack, and send a [osc~ 440]*10 ...
but when you connect this output to the system output, you will get clipping.
afaik, you get something similar on OSX, where the (portaudio) API will take floating point samples, and the signal gets sent through a limiter to prevent obvious clipping.
so the bottom line is: hardware always has a physical range limit (that is mapped to -1..+1). but Pd is software and some audio APIs can handle sample values in floating point format just fine. with these, you most likely don't get any *immediate* problems if the range exceeds -1..+1. however, how excessive samples are handled is highly depending on the audio API and eventually other components in the signal chain. so if you do want to output signals that are outside -1..+1, you are on your own (from Pd's perspective).
within those limits (if the interpolated waveform between samples goes over the limit).
well, the reconstruction filters in the DAC won't necessarily clip in this case.
gfamdsr IOhannes
However, it's probably wise to clip the signal before sending it to dac~. Entirely for health and safety reasons!
*www.peimankhosravi.co.uk http://www.peimankhosravi.co.uk || RSS Feed http://peimankhosravi.co.uk/miscposts.rss || Concert News http://spectralkimia.wordpress.com/*
On 21 December 2013 13:48, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 2013-12-20 23:34, Martin Peach wrote:
On 2013-12-20 16:55, Alexandre Torres Porres wrote:
Hi there, where can I find info about headroom and clipping on Pd. Or can anyone tell me quickly how it goes?
Does it always really clip over a maximum of 1, or is there some headroom? Does it depend on the audiocard or something?
The soundcard will always clip above +1 and below -1, and sometimes even
yes, but the output of Pd (what you send to [dac~]) is not necessarily sent directly to the soundcard: e.g when using jack, the samples will be passed as floating point values to the next client: so samples exceeding -1..+1 need not clip at all. you can confirm this by connecting the output of Pd to the input of Pd via jack, and send a [osc~ 440]*10 ...
but when you connect this output to the system output, you will get clipping.
afaik, you get something similar on OSX, where the (portaudio) API will take floating point samples, and the signal gets sent through a limiter to prevent obvious clipping.
so the bottom line is: hardware always has a physical range limit (that is mapped to -1..+1). but Pd is software and some audio APIs can handle sample values in floating point format just fine. with these, you most likely don't get any *immediate* problems if the range exceeds -1..+1. however, how excessive samples are handled is highly depending on the audio API and eventually other components in the signal chain. so if you do want to output signals that are outside -1..+1, you are on your own (from Pd's perspective).
within those limits (if the interpolated waveform between samples goes over the limit).
well, the reconstruction filters in the DAC won't necessarily clip in this case.
gfamdsr IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 2013-12-21 14:58, peiman khosravi wrote:
However, it's probably wise to clip the signal before sending it to dac~. Entirely for health and safety reasons!
this really depends...a clipping sine will have loads of high frequencies that might be equally damaging to your audience.
if you want to be safe, use math to make sure that your signal won't exceed -1..+1 before sending to the [dac~].
or use a limiter (zexy has a handy one).
fgmrdsa IOhannes
here's the deal, if I have a square wave in Pd running at 1 -1 peak to peak, then you say that should be my maximum output, right?
Thing is that if I give it an extra boost (say, multiply it by 2) I can clearly listen an increase in loudness. Hence, something in my system is allowing some headroom to be output.
I got a macbook air from 2010 running 10.7.5... if Pd is not responsible for this, maybe my hardware + Mac OS is?
here's the patch, try yourselves and tell me what you get please.
Cheers
#N canvas 653 26 257 182 10; #X obj 79 97 dac~; #X obj 85 41 square~ 440; #X floatatom 125 72 5 0 0 0 - - -; #X obj 85 70 *~; #X connect 1 0 3 0; #X connect 2 0 3 1; #X connect 3 0 0 0; #X connect 3 0 0 1;
2013/12/21, IOhannes m zmölnig zmoelnig@iem.at:
On 2013-12-21 14:58, peiman khosravi wrote:
However, it's probably wise to clip the signal before sending it to dac~. Entirely for health and safety reasons!
this really depends...a clipping sine will have loads of high frequencies that might be equally damaging to your audience.
if you want to be safe, use math to make sure that your signal won't exceed -1..+1 before sending to the [dac~].
or use a limiter (zexy has a handy one).
fgmrdsa IOhannes
On 2013-12-29 10:08, Alexandre Torres Porres wrote:
here's the deal, if I have a square wave in Pd running at 1 -1 peak to peak, then you say that should be my maximum output, right?
Thing is that if I give it an extra boost (say, multiply it by 2) I can clearly listen an increase in loudness. Hence, something in my system is allowing some headroom to be output.
I got a macbook air from 2010 running 10.7.5... if Pd is not responsible for this, maybe my hardware + Mac OS is?
Yes it's a Mac-specific issue. On Win7 I get no difference above 1.0. The Apple audio driver is responsible for "clipping" values outside of [-1.0..1.0] as they arrive from possibly multiple applications. The docs state that clipping can be done in a "soft" way, so I suspect that the default driver (for the headphone output) is doing some sort of compression. Possibly if you use an external interface this won't happen (?).
(see for example https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptu... ) Martin
here's the patch, try yourselves and tell me what you get please.
Cheers
#N canvas 653 26 257 182 10; #X obj 79 97 dac~; #X obj 85 41 square~ 440; #X floatatom 125 72 5 0 0 0 - - -; #X obj 85 70 *~; #X connect 1 0 3 0; #X connect 2 0 3 1; #X connect 3 0 0 0; #X connect 3 0 0 1;
2013/12/21, IOhannes m zmölnig zmoelnig@iem.at:
On 2013-12-21 14:58, peiman khosravi wrote:
However, it's probably wise to clip the signal before sending it to dac~. Entirely for health and safety reasons!
this really depends...a clipping sine will have loads of high frequencies that might be equally damaging to your audience.
if you want to be safe, use math to make sure that your signal won't exceed -1..+1 before sending to the [dac~].
or use a limiter (zexy has a handy one).
fgmrdsa IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
This is frightening - if I were a musician reading this I'd be frightened to ever use Appe software in a serious project.
(Of course, we do't know what happens in Windows under the hood either. The only way you can truly know what you're getting is to use an open-source OS.
cheers Miller
On Sun, Dec 29, 2013 at 12:12:04PM -0500, Martin Peach wrote:
On 2013-12-29 10:08, Alexandre Torres Porres wrote:
here's the deal, if I have a square wave in Pd running at 1 -1 peak to peak, then you say that should be my maximum output, right?
Thing is that if I give it an extra boost (say, multiply it by 2) I can clearly listen an increase in loudness. Hence, something in my system is allowing some headroom to be output.
I got a macbook air from 2010 running 10.7.5... if Pd is not responsible for this, maybe my hardware + Mac OS is?
Yes it's a Mac-specific issue. On Win7 I get no difference above 1.0. The Apple audio driver is responsible for "clipping" values outside of [-1.0..1.0] as they arrive from possibly multiple applications. The docs state that clipping can be done in a "soft" way, so I suspect that the default driver (for the headphone output) is doing some sort of compression. Possibly if you use an external interface this won't happen (?).
(see for example https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptu... ) Martin
here's the patch, try yourselves and tell me what you get please.
Cheers
#N canvas 653 26 257 182 10; #X obj 79 97 dac~; #X obj 85 41 square~ 440; #X floatatom 125 72 5 0 0 0 - - -; #X obj 85 70 *~; #X connect 1 0 3 0; #X connect 2 0 3 1; #X connect 3 0 0 0; #X connect 3 0 0 1;
2013/12/21, IOhannes m zmölnig zmoelnig@iem.at:
On 2013-12-21 14:58, peiman khosravi wrote:
However, it's probably wise to clip the signal before sending it to dac~. Entirely for health and safety reasons!
this really depends...a clipping sine will have loads of high frequencies that might be equally damaging to your audience.
if you want to be safe, use math to make sure that your signal won't exceed -1..+1 before sending to the [dac~].
or use a limiter (zexy has a handy one).
fgmrdsa IOhannes
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list