View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Silence removal in speech signals

4.2 | 5 ratings Rate this file 77 Downloads (last 30 days) File Size: 958 KB File ID: #28826 Version: 1.1
image thumbnail

Silence removal in speech signals



24 Sep 2010 (Updated )

A simple method for silence removal in speech streams

| Watch this File

File Information

This is a simple method for silence removal and segmentation of audio streams that contain speech. The method is based in two simple audio features (signal energy and spectral centroid). As long as the feature sequences are extracted, as thresholding approach is applied on those sequence, in order to detect the speech segments.

More advanced silence removal and general audio analysis methods can be found in the MATLAB AUDIO ANALYSIS LIBRARY ( which is part of the book INTRODUCTION TO AUDIO ANALYSIS: A MATLAB APPROACH (

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
08 Oct 2016 hanan hasham

Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be
aware that exceeding your available stack space can crash MATLAB and/or your computer.this error appears when debugging this code

Comment only
29 Jul 2016 ayesha jabeen

29 Jul 2016 ayesha jabeen

but if we want to save these silence intervals than which function we need to performed?

Comment only
02 Jul 2013 Mojtaba

Ooops, it should be like this
output = [output; segments{i}];

Comment only
02 Jul 2013 Mojtaba

Thanks, It has very helpful comments and also works perfectly. It is also possible to add a few lines of code to concatenate the cell "segments" in order to have the removed silence version of the input signal, e.g.:

function [segments, fs, output] = detectVoiced(x, t)

output = [];
for i = length(segments)
output = [segments{i}; output];

29 May 2013 muthu

muthu (view profile)

how to run this coding give the steps and also i want use this code for my research work

Comment only
13 May 2013 Erina

Erina (view profile)

Has this video been removed? I cant take a look at it.

Comment only
14 Mar 2013 Theodoros Giannakopoulos

Dear Nikolay. First of all thank you for your comments. Some notes on them:
(a) mp3 IO was not supported in older Matlab versions. Furthermore, audioread seems to have some OS compatibility issues, so I stuck with WAV file format only. Personally, I prefer to use some extrernal script for transcoding (e.g. commandline ffmpeg...)
(b) optioned listening seems right to me to: I will change this in the future
(c) GUI is also some fututre plan
(d) It's true that the precision / recall is not 100%: this is due to the very simple audio features adopted. One can rely to more sophisticated features for better results (e.g. mfccs, other spectral features etc).
I'd be glad to see your new results using and expanding this algorithm.
Again, thank you for your comments!

Comment only
12 Mar 2013 Nikolay S.

Nikolay S. (view profile)

Excellent submission, works fine on the example, and additional files. Almost what I was looking for. Luckily I’ve checked the File Exchange before I’ve written a version of my own. In my case I’m interested in removing silence gaps form several hours recording from some sort of an audio surveillance device. This way I wish to save listeners time and storage space. A few comments, if I may:
• Why limiting the supported file formats to .wav? “audioread” supports MP3 and many other common audio formats.
• For my case I am not always interested to listen to the segments with voice/audio data, though I’d like to have the option.
• I am interested is storing relevant segments, ignoring silence gaps and irrelevant segments. This naturally demands some dialogs and GUI.
• I’ve noted sometimes speech is not properly detected, I’m still investigating this...
I plan to work on your code, to shape it into the application I want (which is a bit different from the current functionality). As mentioned above your code is an excellent starting point. If you want to, I can share the results later on, perhaps even submitting it.
Keep up the good work!

22 Apr 2012 Son Duong

19 Dec 2010 Mahfouz

18 Mar 2014 1.1

Minor changes in description

Contact us