how to remove silent regions from speech signal dynamically

1 view (last 30 days)
%program to remove silences from a speech recording %step 1- break the signal into frames of 0.1seconds fs=11250; %fs=22050; frame_duration=0.1; frame_len=frame_duration*fs; N=length(ip); num_frames=floor(N/frame_len); new_sig=zeros(N,1); count=0; %frame1=ip(1:frame_len); %frame2=ip(frame_len+1 :frame_len*2) %frame3=ip(frame_len*2+1 :frame_len*3) for k=1:num_frames %extract a frame of speech frame=ip( (k-1) *frame_len +1 : frame_len*k); %step2 - identify silence by finding frames with max amplitude less than 0.03
max_val=max(frame);
if(max_val>0.03) %this frame is not silent count=count+1;
new_sig( (count-1)*frame_len +1 :frame_len*count)=frame;
end end
here 0.03 is set as threshold instead how can we do it dynamically.
Thank you

Accepted Answer

Image Analyst
Image Analyst on 29 May 2014
Would this "File Exchange Pick of the Week" be of any use to identify and discriminate between silence and valid sounds: http://blogs.mathworks.com/pick/2014/05/23/automatic-activity-detection-using-hilbert-transform/

More Answers (0)

Categories

Find more on Simulation, Tuning, and Visualization in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!