how to use Truncate Silence

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
kfzhs
Posts: 3
Joined: Wed Oct 14, 2009 6:40 am
Operating System: Please select

how to use Truncate Silence

Post by kfzhs » Wed Oct 14, 2009 6:46 am

what's the meaningof "Min silence duration","Max silence duration","silence compression"?

jademan
Forum Crew
Posts: 1425
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: how to use Truncate Silence

Post by jademan » Tue Oct 20, 2009 1:32 pm

kfzhs wrote:what's the meaningof "Min silence duration","Max silence duration","silence compression"?
Good question. I believe this version of Truncate Silence is new in 1.3.8 and has not yet been documented. Also there were some diffuculties with it in 1.3.8 that were supposedly corrected, see here.

When I generated a DTMF tone, then ran Truncate Silence, the resulting silences were of differing lengths, so I suspect somethings is amiss. I'll send an email to the developers - I believe they are working on a related bug fix now. In the meantime, I believe it does work properly in 1.3.7.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: how to use Truncate Silence

Post by Gale Andrews » Tue Oct 20, 2009 9:58 pm

jademan wrote:(sent to feedback:@)
On Windows, XP HE SP3, I used Audacity 1.3.9 to Generate DTMF tones with
the following default settings:

55% duty ratio
3278 ms tone duration
2682 ms silence duration
amplitude .8

I then ran Truncate Silence with the default settings of 200, 1000, 4,
-40. After I did this, I measured the resulting silences between the
tones. The first three silences were: 404 ms, 659 ms, 820 ms
respectively. One might expect them all to be the same.
John, those aren't the default parameters. Tone duration and silence duration depend on the sequence and the duration chosen. On a fresh cfg, the sequence is "audacity" and duration is 1 second which gives a tone duration of 72ms and silence duration of 59 ms. You would have to tell me what sequence and duration you are using for me to test those parameters, but using default truncate silence parameters on an "audacity" DTMF sequence of 30 seconds length (which gives a tone duration of 2185 ms and silence duration of 1788 ms), the truncated silences were of equal
length in 1.3.9 and 1.3.10 Alpha.

However, then I added labels and I could find unequal truncation. Then I could find unequal truncation after clearing to a fresh project and truncating a DTMF tone without labels. Please try with one track in 1.3.9 and give me your exact sequence and duration. Try it with and without labels.


Gale
Last edited by Gale Andrews on Fri Apr 24, 2015 3:13 pm, edited 4 times in total.
Reason: Truncation appeared after using labels, then seemed to be there even without labels
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

jademan
Forum Crew
Posts: 1425
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: how to use Truncate Silence

Post by jademan » Wed Oct 21, 2009 2:10 am

Gale,

You were right. I have an error of omission. I had changed the DTMF time duration to 45 seconds. This may be why you could not duplicate the numbers.

OK, here is what I did:

1) In audacity.cfg, deleted all lines except:
NewPrefsInitialized=1
2) Started Audacity 1.3.9
3) Language=English
4) Welcome: OK
5) Generate > DTMF Tones
6) Duration: 45 seconds
7) OK
8) Effect > Truncate Silence > OK
9) Here the periods of silence between the tones are visibly different, increasing slowly in size.
10) Up to this point, no labels are involved.
11) First 4 interval durations (I created labels to measure them):
404 ms
659 ms
820 ms
820 ms
Total number of intervals: 7.
Length of last interval: 820ms
Total clip length: 31.39 seconds.
7 intervals.

Anyway, these results are identical to my previous tests, which is the original problem report.

Gale, when I repeat the test using labels, where do you want me to put the labels ?

billw58
Forum Staff
Posts: 5600
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: how to use Truncate Silence

Post by billw58 » Wed Oct 21, 2009 4:20 am

jademan wrote: OK, here is what I did:
...
First 4 interval durations
404 ms
659 ms
820 ms
820 ms
I can report identical results (within 2 or 3 ms) on Mac with 1.3.10-alpha-Oct 19 2009.

-- Bill

WCC
Posts: 1
Joined: Wed Oct 14, 2009 10:07 pm
Operating System: Please select

Re: how to use Truncate Silence

Post by WCC » Thu Oct 22, 2009 12:09 am

Does anybody have information on the cause of these short periods of silence in a recorded track. The sound monitored on the speakers while recording does not contain this annoying silence periods. I'm using Audacity 1.3.9 with Windows XP.

jademan
Forum Crew
Posts: 1425
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: how to use Truncate Silence

Post by jademan » Thu Oct 22, 2009 1:50 am

WCC wrote:Does anybody have information on the cause of these short periods of silence in a recorded track. The sound monitored on the speakers while recording does not contain this annoying silence periods. I'm using Audacity 1.3.9 with Windows XP.
WCC,

From your description, it is hard to tell what you are talking about. As Steve would say, "If the file is less than 50MB, could you upload the file onto the internet somewhere and post a link. http://www.sendspace.com/ is pretty good (and free)." When you do this, please start a new thread, as this sounds like a different subject. Also, when you repost, please include your OS, and Audacity version. Are you running 1.2.6 or 1.3.9 ? Also, how did you make your recording ? Many Thanks. :)

jademan
Forum Crew
Posts: 1425
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: how to use Truncate Silence

Post by jademan » Thu Oct 22, 2009 2:11 am

Gale,

I repeated the above tests with label tracks. I placed 8 labels in seemingly random locations, but I put individual labels on tones and on silent spots. After applying Truncate Silence, I seemed to have the identical discrepancies to the waveform as in the above test. When the label track was not linked, the label track was not changed. When the label track was linked, the label track was truncated. The labels did not move with the waveform, as I might have expected. Note that I did not record or verify the label locations with great accuracy.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: how to use Truncate Silence

Post by Gale Andrews » Sat Oct 24, 2009 8:16 am

jademan wrote:Gale,I repeated the above tests with label tracks. I placed 8 labels in seemingly random locations, but I put individual labels on tones and on silent spots. After applying Truncate Silence, I seemed to have the identical discrepancies to the waveform as in the above test. When the label track was not linked, the label track was not changed. When the label track was linked, the label track was truncated. The labels did not move with the waveform, as I might have expected. Note that I did not record or verify the label locations with great accuracy.
John, it's a known P3 bug that truncate silence doesn't keep labels in synchronisation. It seems the fact that adding a label track causing unequal truncation was some kind of aberration. Almost always, I can replicate unequal truncation with a 30 seconds "audacity" DTMF followed by default truncation. One other time too, it produced equal silences of 596 ms. Every other time it produced silences of 596ms but the third one much shorter at 408ms.

The changes to Truncate have not yet been user-documented. In the previous Truncate, there was only one setting (Max silence duration) that determined the resultant length of silence after truncation. Now there are three settings which as far as I can see mutually interact both with each other and with the length of the silence itself to produce the resultant silence. As you will note from the examples above, the default settings do not give a resultant silence of 1000 ms, even if you applied it to a single silence. The resultant silence can be less or more than the max silence figure.

The "compression" factor increases the amount of truncation beyond the amount that the effect would otherwise produce, a value of "1" (to 1) not changing the result and the default "4" making the silence four times as short. Because the compression operates on both the min and max values the results are quite complex.

Imagine 10 seconds of silence in a 30 seconds track:

Settings of min 100, max 5000 give you:
compression 1: 5s
compression 2: 5s
compression 4: 2.5s
compression 10: 1s

Settings of min 2000, max 5000 give you:
compression 1: 6.888s
compression 2: 6.888s
compression 4: 5.416s
compression 10: 4.499s

Settings of min 2001, max 2001 give you:
compression 1: 3.889 seconds

Settings of min 1, max 2001 and min 1000, max 2001 both give you:
compression 1: 2.000 s
compression 4: 529 ms (why not 500)?

I've given examples of max settings of 2001ms because there is a definite bug: Truncate will give you 1 ms less than the silence you ask for, except in the case where you ask for 1ms where it will give you "approximately" 1ms.

I've found one group of settings that I believe will always give you the resultant truncation you ask for in the max silence input (including in DTMF and other tracks with multiple silences):

Min Silence: 1ms
Max Silence: <your required silence> + 1ms (so if you want 10ms, put 11ms here)
Silence compression: 1


I've measured resultant silences by Edit > Detach at Silences and snapping the selection to the whitespace between clips. I'm not a mathematician, so I've asked Phil (the author) if he can drop by and comment on the above findings, in particular the 529/500 ms discrepancy in the last example above, and whether the unequal truncation is expected in the scenarios quoted. If it helps, Phil quotes the maths as follows:

(output) = ((min) + (input - min)/compression) with the constraint that output < max

Phil gave a use case for the new features as follows:

"As an example, you can set the minimum to 100 ms, the maximum to 5000 ms, and the compression factor to 4:1, and it will have the result of about a 2x speedup in speech with no pitch change, and keeping about the same cadence as the original."

That may be useful as a specialist case, however for more basic users I am concerned that the defaults in most cases will not give you the max silence requested (nor will setting compression to "1" always give the requested value). If the "+1 second" issue can be addressed and if my conclusion is right, I suggest "min silence:1, max silence:1000, compression:1" should be the defaults.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

jademan
Forum Crew
Posts: 1425
Joined: Fri Jul 17, 2009 10:11 pm
Operating System: Windows 10

Re: how to use Truncate Silence

Post by jademan » Mon Oct 26, 2009 3:29 am

Gale Andrews wrote:
jademan wrote:Gale,I repeated the above tests...
John, it's a known P3 bug that truncate silence doesn't keep labels...
Gale, when I originally reviewed your reply, I was confused, because although you covered the material, it wasn't apparent that you were responding directly to the complaint, or to Bill's verification that the identical problem occurs on a MAC:
jademan wrote:...
OK, here is what I did:

1) In audacity.cfg, deleted all lines except:
NewPrefsInitialized=1
2) Started Audacity 1.3.9
3) Language=English
4) Welcome: OK
5) Generate > DTMF Tones
6) Duration: 45 seconds
7) OK
8) Effect > Truncate Silence > OK
9) Here the periods of silence between the tones are visibly different, increasing slowly in size.
10) Up to this point, no labels are involved.
11) First 4 interval durations (I created labels to measure them):
404 ms
659 ms
820 ms
820 ms
Total number of intervals: 7.
Length of last interval: 820ms
Total clip length: 31.39 seconds.
7 intervals...
billw58 wrote:
jademan wrote:...
404 ms
659 ms
820 ms
820 ms
I can report identical results (within 2 or 3 ms) on Mac with 1.3.10-alpha-Oct 19 2009.
-- Bill
The problems that we have measured do not seem to be related at all to label tracks. When, at your request, I have used labels in conjunction with truncate, what I have noticed is the labels are not moved at all. Instead, some are simply deleted.
But enough on labels. Again, labels are not related to the problems we are reporting.
Gale Andrews wrote:...Almost always, I can replicate unequal truncation with a 30 seconds "audacity" DTMF followed by default truncation. One other time too, it produced equal silences of 596 ms. Every other time it produced silences of 596ms but the third one much shorter at 408ms.
Without using labels, I am also able to reproduce this problem. The 1.788ms silence is reduced to 596ms, but on the third it is 408ms.
Gale Andrews wrote:...
Imagine 10 seconds of silence in a 30 seconds track:

Settings of min 100, max 5000 give you:
compression 1: 5s
compression 2: 5s
compression 4: 2.5s
compression 10: 1s

Settings of min 2000, max 5000 give you:
compression 1: 6.888s
compression 2: 6.888s
compression 4: 5.416s
compression 10: 4.499s

Settings of min 2001, max 2001 give you:
compression 1: 3.889 seconds

Settings of min 1, max 2001 and min 1000, max 2001 both give you:
compression 1: 2.000 s
compression 4: 529 ms (why not 500)? ...
When I tried sandwiching a 10s silence between two 10s tones, I got in your first case:
4.999s, 4.999s, 2.574, 1.089s
in the second case:
6.888s, 6.888s, 5.416s, 4.499s
In the third case:
3.889
and in the fourth case:
2.000s, 1.279s.
Gale Andrews wrote:...
I've measured resultant silences by Edit > Detach at Silences and snapping the selection to the whitespace between clips.
Thank you for this tip. This has proven to be helpful to me.
Gale Andrews wrote:...
I'm not a mathematician, so I've asked Phil (the author) if he can drop by and comment on the above findings, in particular the 529/500 ms discrepancy in the last example above, and whether the unequal truncation is expected in the scenarios quoted. If it helps, Phil quotes the maths as follows:

(output) = ((min) + (input - min)/compression) with the constraint that output < max
Yes. This helps. So inputs that are shorter in length than min are ignored (left alone). And inputs that are longer than min are compressed but only by the extent that they exceed the minimum (ignore) length. And the output is not to exceed the maximum specified.

However, since it is not intuitively obvious, don't you think this formula should be posted on the Truncate Silence Parameter screen ?

Perhaps also because the whole objective of this new algorithm is to compress the spaces, do you think the compression factor should be specified first, then the minimum and maximum?

This leaves the question of why you get 529ms, I get 1.279s, and why our 30s and 45s DTMF tones silence periods don't match the formula. And there was another case (which is why i sandwiched) where a leading silence interval was unaltered altogether.

In any case, I feel much more comfortable about this whole routine now. I'll be anxious to hear what Phil has to say.

Locked