sox-users@lists.sourceforge.net unofficial mirror
 help / color / Atom feed
* Re: How does the Sox Compand Transfer Function Work?
@ 2018-09-27  2:46 Todd Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Todd Hartman @ 2018-09-27  2:46 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 687 bytes --]

Thanks for the reply. Sorry about the non-text. Here's a blog post with my question (essentially the same as the email)https://wordpress.com/post/thewhackhacker.wordpress.com/486
I (think I) understand the theory explained in the mall archives you mentioned. My observation is that sox doesn't behave in a manner consistent with that explanation.
I have been unable to compress an audio signal to the 0 - -20dB range, regardless of the transfer function I used, even though I thought I had crafted some that should have worked, per the explained theory.
What am I doing wrong, or what don't I understand, that the transfer functions I tried don't produce my expected results?

todd.
null

[-- Attachment #1.2: Type: text/html, Size: 1350 bytes --]

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><font face="sans-serif">Thanks for the reply. Sorry about the non-text. Here's a blog post with my question (essentially the same as the email)</font><div><font face="sans-serif" dir="auto">https://wordpress.com/post/thewhackhacker.wordpress.com/486</font></div><div><font face="sans-serif" dir="auto"><br></font></div><div><font face="sans-serif" dir="auto">I (think I) understand the theory explained in the mall archives you mentioned. My observation is that sox doesn't behave in a manner consistent with that explanation.</font></div><div><font face="sans-serif" dir="auto"><br></font></div><div><font face="sans-serif" dir="auto">I have been unable to compress an audio signal to the 0 - -20dB range, regardless of the transfer function I used, even though I thought I had crafted some that should have worked, per the explained theory.</font></div><div><font face="sans-serif" dir="auto"><br></font></div><div><font face="sans-serif" dir="auto">What am I doing wrong, or what don't I understand, that the transfer functions I tried don't produce my expected results?</font></div><div><font face="sans-serif" dir="auto"><br></font></div><div><font face="sans-serif" dir="auto"><br></font></div><div><font face="sans-serif" dir="auto">todd.</font></div>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How does the Sox Compand Transfer Function Work?
@ 2018-09-27 11:14 Todd Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Todd Hartman @ 2018-09-27 11:14 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 128 bytes --]

The link was wrong. Here's the blog post with details.https://thewhackhacker.wordpress.com/2018/09/26/companding-with-sox/

null

[-- Attachment #1.2: Type: text/html, Size: 271 bytes --]

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><font face="sans-serif">The link was wrong. Here's the blog post with details.</font><div>https://thewhackhacker.wordpress.com/2018/09/26/companding-with-sox/</div><div><br></div>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How does the Sox Compand Transfer Function Work?
  2018-09-26  1:20 ` Todd Hartman
@ 2018-09-26 20:00   ` Eric Wong
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2018-09-26 20:00 UTC (permalink / raw)
  To: sox-users

Your message is just a wall of text with paragraph breaks when
rendered with my terminal mail client.

Just replying to the Subject of your post; fmiser has some
EXCELLENT explanations of compand in the list archives:

https://public-inbox.org/sox-users/20100922043937.778a1914.fmiser@gmail.com/
https://public-inbox.org/sox-users/20090829011522.cf27e6ee.fmiser@gmail.com/

I've found his posts extremely informative when learning sox myself.


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How does the Sox Compand Transfer Function Work?
       [not found] <CAKWhy8Mp6+zf1S++tffUk_Y=kb7YsVvOQ4dzWzU6+-_mNGw=LA@mail.gmail.com>
@ 2018-09-26  1:20 ` Todd Hartman
  2018-09-26 20:00   ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Todd Hartman @ 2018-09-26  1:20 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1.1: Type: text/plain, Size: 2860 bytes --]



Sox's Compand Transfer FunctionI’m having trouble choosing compand parameters to get the results I want. I believe the problem is in my engineering the transfer function for sox’s compand effect.According to the sox docs:compand attack1,decay1{,attack2,decay2}
        [soft-knee-dB:]in-dB1[,out-dB1]{,in-dB2,out-dB2} 
        [gain [initial-volume-dB [delay]]]
My goal is to compress all the audio in a file to the top 20 dB of the available amplitude range (to overcome the noisy environment in which I’ll be listening).ExperimentHere’s a plot of the first ~25 seconds of the file. (Note: my method for plotting dB is potentially suspect. The Python code for it may be found here).Recommended: -70,-60,-20The sox docs also list a “common” transfer set of parameters: 0.3,1 6:−70,−60,−20 −5 −90 0.2. I used something similar: 0,.1 -70,-60,-20 (leaving out the gain, initial volume, and optional soft-knee value).The sox docs describe this transfer function:The transfer function (‘6:−70,...’) says that very soft sounds (below −70dB) will remain unchanged. This will stop the compander from boosting the volume on ‘silent’ passages such as between movements. However, sounds in the range −60dB to 0dB (maximum volume) will be boosted so that the 60dB dynamic range of the original music will be compressed 3-to-1 into a 20dB range, which is wide enough to enjoy the music but narrow enough to get around the road noise.When I tell sox to plot the transfer function, I expect output levels to be mostly in the -20dB - 0dB range.When I plot the resulting dB level of the audio, I get this:This is not what I expected. I was expecting the dB level to be almost entirely in the -20dB - 0dB range, but what I see is most of it in the -60dB - 0dB range. What is wrong with my expectations?I attempted a few other transfer functions, with results a little more to my liking, but never what I was expecting or wanted.-70,-60,-10Plotting the transfer function:I expected all the meaningful audio to be compressed into the -10dB - 0dB range.-91,-90,-10Plotting the transfer function:I expected a great deal of compression (nearly everything in the -10dB - 0dB range).Conclusions?I can only barely tell a difference between the results of the various transfer functions I tried. At no point was the dB level of the audio compressed to within the range I was expecting.Sox Source Code
https://github.com/chirlu/sox/blob/master/src/compand.c
Examination of this file doesn't sufficiently enlighten me to enable me to get what I want out of companding. I don't have criticism of the code—I just don't understand it.What do I not understand about the transfer function?I don't see the actual output of Sox's compand doing what is described in the docs. Can you help me understand how to use the compand effect?Thanks.

todd.


[-- Attachment #1.2: Type: text/html, Size: 25098 bytes --]

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div><br></div><div style="font-size:100%;color:#000000"></div><div style="font-size:100%;color:#000000"><!-- originalMessage --><div><br></div></div><div dir="ltr"><div class="gmail-votecell gmail-post-layout--left" style="margin:0px;padding:0px 15px 0px 0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;font-size:13px;vertical-align:top;box-sizing:inherit;width:auto;color:rgb(67,70,72)"><div class="gmail-vote" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;text-align:center;min-width:46px"><span class="gmail-vote-count-post" style="margin:10px 0px 5px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;font-size:20px;vertical-align:baseline;box-sizing:inherit;display:block;color:rgb(106,115,124)">Sox's Compand Transfer Function</span><div class="gmail-favoritecount" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(106,115,124);background-color:rgb(255,255,255)"></span></div></div></div><div class="gmail-postcell gmail-post-layout--right" style="margin:0px;padding:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;vertical-align:top;box-sizing:inherit;width:auto;min-width:0px;color:rgb(67,70,72)"><div class="gmail-post-text" style="margin:0px 0px 5px;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;width:667px;word-wrap:break-word"><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">I’m having trouble choosing compand parameters to get the results I want. I believe the problem is in my engineering the transfer function for sox’s compand effect.</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">According to the&nbsp;<a href="http://sox.sourceforge.net/sox.html" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none">sox docs</a>:</span></p><pre style="font-style:inherit;font-size:13px;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,&quot;Lucida Console&quot;,&quot;Liberation Mono&quot;,&quot;DejaVu Sans Mono&quot;,&quot;Bitstream Vera Sans Mono&quot;,&quot;Courier New&quot;,monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,&quot;Lucida Console&quot;,&quot;Liberation Mono&quot;,&quot;DejaVu Sans Mono&quot;,&quot;Bitstream Vera Sans Mono&quot;,&quot;Courier New&quot;,monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;white-space:inherit;background-color:rgb(255,255,255)">compand attack1,decay1{,attack2,decay2}
        [soft-knee-dB:]in-dB1[,out-dB1]{,in-dB2,out-dB2} 
        [gain [initial-volume-dB [delay]]]
</code></pre><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">My goal is to compress all the audio in a file to the top 20 dB of the available amplitude range (to overcome the noisy environment in which I’ll be listening).</span></p><h2 style="font-style:inherit;font-size:19px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:400;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;word-wrap:break-word"><span style="background-color:rgb(255,255,255)">Experiment</span></h2><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">Here’s a plot of the first ~25 seconds of the file. (Note: my method for plotting dB is potentially suspect. The Python code for it may be found&nbsp;<a href="https://pastebin.com/pRmSxfJU" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none">here</a>).</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/LefEO.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/LefEO.png" alt="original audio intensity" id="exifviewer-img-1" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><h3 style="font-style:inherit;font-size:17px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:400;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;word-wrap:break-word"><span style="background-color:rgb(255,255,255)">Recommended: -70,-60,-20</span></h3><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">The sox docs also list a “common” transfer set of parameters:&nbsp;<code style="margin:0px;padding:1px 5px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,&quot;Lucida Console&quot;,&quot;Liberation Mono&quot;,&quot;DejaVu Sans Mono&quot;,&quot;Bitstream Vera Sans Mono&quot;,&quot;Courier New&quot;,monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap">0.3,1 6:−70,−60,−20 −5 −90 0.2</code>. I used something similar:&nbsp;<code style="margin:0px;padding:1px 5px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,&quot;Lucida Console&quot;,&quot;Liberation Mono&quot;,&quot;DejaVu Sans Mono&quot;,&quot;Bitstream Vera Sans Mono&quot;,&quot;Courier New&quot;,monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;white-space:pre-wrap">0,.1 -70,-60,-20</code>&nbsp;(leaving out the gain, initial volume, and optional soft-knee value).</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">The sox docs describe this transfer function:</span></p><blockquote style="font-style:inherit;font-size:15px;margin:0px 0px 10px;padding:10px;border-width:0px 0px 0px 2px;border-top-style:initial;border-right-style:initial;border-bottom-style:initial;border-left-style:solid;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-left-color:rgb(255,235,142);font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;quotes:none;box-sizing:inherit"><p style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">The transfer function (‘6:−70,...’) says that very soft sounds (below −70dB) will remain unchanged. This will stop the compander from boosting the volume on ‘silent’ passages such as between movements. However, sounds in the range −60dB to 0dB (maximum volume) will be boosted so that the 60dB dynamic range of the original music will be compressed 3-to-1 into a 20dB range, which is wide enough to enjoy the music but narrow enough to get around the road noise.</span></p></blockquote><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">When I tell sox to plot the transfer function, I expect output levels to be mostly in the -20dB - 0dB range.</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/evEe8.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/evEe8.png" alt="sox compand plot -70,-60,-20" id="exifviewer-img-2" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">When I plot the resulting dB level of the audio, I get this:</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/h42V4.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/h42V4.png" alt="audio intensity after compand -70,-60,-20" id="exifviewer-img-3" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">This is not what I expected. I was expecting the dB level to be&nbsp;<em style="margin:0px;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">almost</em>&nbsp;entirely in the -20dB - 0dB range, but what I see is most of it in the -60dB - 0dB range.&nbsp;<em style="margin:0px;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">What is wrong with my expectations?</em></span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">I attempted a few other transfer functions, with results a little more to my liking, but never what I was expecting or wanted.</span></p><h3 style="font-style:inherit;font-size:17px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:400;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;word-wrap:break-word"><span style="background-color:rgb(255,255,255)">-70,-60,-10</span></h3><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">Plotting the transfer function:</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/IwdCt.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/IwdCt.png" alt="sox plot transfer function for -70,-60,-10" id="exifviewer-img-4" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">I expected all the meaningful audio to be compressed into the -10dB - 0dB range.</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/76R3Q.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/76R3Q.png" alt="audio intensity levels after compand -70,-60,-10" id="exifviewer-img-5" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><h3 style="font-style:inherit;font-size:17px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:400;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;word-wrap:break-word"><span style="background-color:rgb(255,255,255)">-91,-90,-10</span></h3><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">Plotting the transfer function:</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/aEzSq.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/aEzSq.png" alt="sox plot transfer function for -91,-90,-10" id="exifviewer-img-6" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">I expected a great deal of compression (nearly everything in the -10dB - 0dB range).</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://i.stack.imgur.com/aG6vl.png" rel="nofollow noreferrer" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(24,111,173);text-decoration-line:none;background-color:rgb(255,255,255)"><img src="https://i.stack.imgur.com/aG6vl.png" alt="audio intensity levels after compand -91,-90,-10" id="exifviewer-img-7" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline; box-sizing: inherit; max-width: 100%;" onmouseover="imageMousePointerUpdate(true)" onmouseout="imageMousePointerUpdate(false)"></a></p><h2 style="font-style:inherit;font-size:19px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:400;font-stretch:inherit;line-height:1.3;font-family:inherit;vertical-align:baseline;box-sizing:inherit;word-wrap:break-word"><span style="background-color:rgb(255,255,255)">Conclusions?</span></h2><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="background-color:rgb(255,255,255)">I can only barely tell a difference between the results of the various transfer functions I tried. At no point was the dB level of the audio compressed to within the range I was expecting.</span></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="font-family:inherit;font-size:large;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit">Sox Source Code</span><br></p><p style="font-style:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><a href="https://github.com/chirlu/sox/blob/master/src/compand.c">https://github.com/chirlu/sox/blob/master/src/compand.c</a><br></p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="font-style:inherit">Examination of this file doesn't sufficiently enlighten me to enable me to get what I want out of companding. I don't have criticism of the code—I just don't understand it.</span></p><p style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><strong style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">What do I not understand about the transfer function?</strong></p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both">I don't see the actual output of Sox's compand doing what is described in the docs. Can you help me understand how to use the compand effect?</p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="font-family:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit">Thanks.</span><br></p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><br></p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both">todd.</p><p style="font-size:15px;margin:0px 0px 1em;padding:0px;border:0px;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;clear:both"><span style="font-style:inherit"><br></span></p></div></div></div>
</body></html>

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  2:46 How does the Sox Compand Transfer Function Work? Todd Hartman
  -- strict thread matches above, loose matches on Subject: below --
2018-09-27 11:14 Todd Hartman
     [not found] <CAKWhy8Mp6+zf1S++tffUk_Y=kb7YsVvOQ4dzWzU6+-_mNGw=LA@mail.gmail.com>
2018-09-26  1:20 ` Todd Hartman
2018-09-26 20:00   ` Eric Wong

sox-users@lists.sourceforge.net unofficial mirror

Archives are clonable: git clone --mirror https://public-inbox.org/sox-users

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.sox
	nntp://news.gmane.org/gmane.comp.audio.sox

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox