Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

DEPARTMENT OF ELECTRICAL ENGINEERING

DIGITAL SIGNAL PROCESSING PROJECT

GROUP MEMBER ID NO
1. Alemu Demirachew 00509/12
2. Abraham Alene 00361/12
3. Anwar Wassie 00921/12
4. Amanuel Leta 01894/12

Submitted to
Mr. Belayneh

Submission date
03/08/2015 E.C

1
ABSTRACT
The most important domain in digital signal processing is speech signal processing. This is
because a variety of noise signals could degrade the original speech signal and make it unclear to
user. This project contributes to the literature by developing a program to remove silence from
the original speech signal using framing method and enhance audio quality using equalization
technique.
Audio quality is a crucial factor in audio recordings, and poor quality can make it challenging for
listeners to appreciate the content. In this project, we explore two techniques for enhancing audio
quality: equalization and silence removal. Equalization enables us to adjust the levels of
five equalization bands centered on frequencies of 500 Hz, 1000 Hz, 2000 Hz, 4000 Hz,
and 8000 Hz, allowing us to improve the clarity and balance of music and speech recordings. On
the other hand, silence removal automatically detects and removes periods of silence from
speech recordings, reducing the overall length of recordings and improving the intelligibility of
speech.
We evaluate the effectiveness of these techniques through a series of experiments on several
speech and music recordings. Our results show that equalization is effective in enhancing the
clarity and intelligibility of speech recordings, with the 500 Hz and 1000 Hz bands having the
greatest impact. For music recordings, equalization is effective in enhancing the overall sound
quality, particularly in the midrange frequencies. We also demonstrate that silence removal is
effective in reducing the length of speech recordings, while preserving the flow of speech and
improving the overall quality.
We discuss the potential benefits of these techniques in various real-world applications, such as
teleconferencing, podcasting, and music production. Our findings suggest that these techniques
provide powerful tools for enhancing the quality of audio recordings in various settings, and can
improve the overall listening experience for users. By enhancing the quality of audio recordings,
these techniques can make audio content more enjoyable, accessible, and understandable.

2
ACKNOWLEGMENT
We would like to express our sincere gratitude to Mr. Belayneh, our instructor for the DSP
course, for his invaluable guidance and support throughout this project. His expertise,
knowledge, and enthusiasm for the subject matter have been instrumental in our success.
We would also like to thank the staff of the Department of Electrical and Computer Engineering
for providing us with the necessary resources and facilities to carry out this project.
Finally, we would like to acknowledge the contributions of our team members, who worked
tirelessly to ensure the success of this project. Their hard work, dedication, and team spirit have
been an inspiration to us all.
Thank you all for your support and encouragement. This project would not have been possible
without your help. We are proud of the work we have accomplished, and look forward to
applying the skills and knowledge we have gained in our future endeavors.

3
TABLE OF CONTENT
CONTENT PAGE NO
List of figure……………………………………………………………………....5
Introduction ………………………………………………………………………6
Objective …………………………………………………………………………6
System design……………………………………………………………………..7
Methodology ……………………………………………………………………..9
Result analysis ……………………………………………………………………10
Discussion …………………………………………………………………….......11
Conclusion ………………………………………………………………………..13
Sample code …………………………………………………………………...….13
Reference ………………………………………………………………………….16

4
LIST OF FIGURE
Figure-1: flow chart for audio quality enhancement
Figure-2: flow chart for silence removal from speech
Figure-3: graphic equalizer
Figure-4: original signal
Figure-5: enhanced signal
Figure-6: original audio signal
Figure-7: enhanced audio signal

5
INTRODUCTION

Audio quality is a critical aspect of any audio recording, whether it is music, speech, or
any other kind of sound. Poor audio quality can make it difficult for listeners to enjoy the
content, and can even make it impossible to understand speech or discern individual instruments
in a musical performance. In this project, we explore two techniques for enhancing audio quality:
equalization and silence removal.
Equalization is a powerful tool for shaping the frequency response of an audio signal, allowing
us to boost or cut specific frequency ranges to achieve a desired sound. In this project, we use
a graphic equalizer to adjust the levels of five equalization bands centered on frequencies of 500
Hz, 1000 Hz, 2000 Hz, 4000 Hz, and 8000 Hz. We demonstrate how adjusting these bands can
improve the clarity and balance of music and speech recordings.
Silence removal is a technique for automatically detecting and removing periods of silence from
speech recordings. This can help to reduce the overall length of recordings, making them easier
to manage and store, and can also improve the intelligibility of speech by reducing distracting
pauses and background noise. In this project, we use a simple algorithm to detect periods of
silence in speech recordings and remove them, while preserving the natural pacing and flow of
the speech.
Together, these techniques provide powerful tools for enhancing the quality of audio recordings,
whether for music, speech, or any other kind of sound. We demonstrate the effectiveness of these
techniques through a series of experiments and evaluations, and discuss their potential
applications in a variety of real-world scenarios.

Objective
Develop and implement an effective equalization technique that can adjust the frequency
response of audio recordings to improve their overall quality.
Develop and implement an effective silence removal algorithm that can identify and remove
unwanted silence from speech recordings, without affecting the quality of the speech.
Evaluate the effectiveness of the equalization technique and the silence removal algorithm using
both objective and subjective measures of audio quality, such as SNR, distortion, and perceptual
audio quality ratings.
Compare the performance of the developed system with other existing audio quality
enhancement techniques to determine its effectiveness and superiority.

6
System design
System design is a process of defining the module sand flow data for a system which satisfy
specified requirement. There is different type of system design, but in our project system design
logical one are used.

Here is a system design for an audio quality enhancement project using only equalization:
Input audio signal: Obtain an input audio signal which needs to be enhanced. This can be speech,
music, or any other audio.
Pre-processing: Perform any required pre-processing on the input audio like noise removal,
normalization, etc. This step is optional.
Frequency analysis: Analyze the frequency components in the input audio signal. This can be
done using Fourier Transform (FT) or Fast Fourier Transform (FFT).
Equalizer parameter calculation: Based on the frequency analysis, calculate the equalization
parameters to adjust the gain of different frequency bands. The goal is to balance the frequency
spectrum. These parameters can be determined programmatically or manually tuned.
Equalization: Apply equalization using digital filters like biquadratic filters with the calculated
equalizer parameters. Boost or attenuate different frequency bands to balance the overall
frequency spectrum.
Post-processing: Apply any required post-processing like normalization, smoothing, etc. This
step is optional.

7
Output enhanced audio: The output is an enhanced audio signal with a balanced frequency
spectrum.

Figure-2 flow chart for the silence removal from speech

The key steps are thus feature extraction, thresholding, feature combination, machine learning
approaches and post-processing to build a robust system for silence removal from speech. The
system can be optimized by tuning the thresholds, smoothing parameters, choosing the right
features and models, and applying suitable post-processing techniques.

8
METHODOLOGY
For audio quality enhancement using equalization technique:

The sample code below implements a graphic equalizer for an audio file. The methodology can
be broken down into several steps:
 Create a new figure using the uifigure function to serve as the interface for the graphic
equalizer.
 Define the center frequencies, bandwidths, and gains of the equalization bands as arrays.
 Create a set of sliders using the uislider function to control the gains of each frequency
band. The position, limits, and value of each slider are set using its properties.
 Load an audio file using the audioread function and store the audio data and sampling
rate variables.
 Define a function called update_audio that is called whenever a slider value is changed.
This function calculates the filter coefficients for each equalization band using a second-
order IIR filter, applies the filter to the audio data using the filter function, and sums the
filtered outputs to create the equalized audio output. The maximum amplitude of the
equalized audio is normalized to 1, and the original and equalized audio signals are
plotted using the plot function.
 Define a function called get_slider_values that returns an array of the current slider
values.
 The main function called graphic_equalizer is defined that creates the figure, sets the
slider values, and calls the update_audio function whenever a slider value changes.
Overall, this code allows the user to adjust the relative gains of different frequency bands in an
audio file in real-time, resulting in a modified version of the original audio signal. The equalized
signal can be played back through the user's speakers or headphones using the sound function.
For silence removal from speech:
The code below performs voice activity detection (VAD) on an input audio file to remove silent
frames that fall below a certain energy threshold. The methodology can be broken down into
several steps:
 Load the input audio file using the audioread function. This returns the audio data and the
sample rate.
 Set the parameters for the VAD algorithm, including the frame size, overlap, and energy
threshold.
 Calculate the number of frames needed to cover the entire audio signal, based on the
frame size and overlap.
 Pre-allocate an output audio array to store the non-silent frames.
 Process each frame of the audio signal using a for loop. For each frame, calculate the start
and end indices of the current frame, extract the current frame of audio data, calculate the
energy of the frame, and add the frame to the output audio array if the energy of the
frame exceeds the energy threshold.
9
 Plot the original and enhanced audio signals using the plot function. The x-axis represents
time in seconds, and the y-axis represents the amplitude of the audio signal.
 Save the output audio array as a new audio file using the audiowrite function.
Overall, this code can be used to remove silent frames from a noisy audio signal, which can be
useful for speech processing tasks such as speech recognition and speaker identification.

RESULT ANALAYSIS
For audio quality enhancement using equalization technique:

Figure-3

Figure-4

10
Figure-5

For silence removal from speech:

Figure-6

Figure-7

11
DISCUSSION
The first code is for a graphic equalizer that allows the user to adjust the relative gains of different
frequency bands in an audio file in real-time, resulting in a modified version of the original audio signal.
The equalized signal can be played back through the user's speakers or headphones using
the sound function.
The second code is for removing silence from a speech audio signal. It divides the audio signal into
frames and checks whether the energy of each frame is above a certain threshold. If the energy is above
the threshold, the frame is added to the output audio. This process effectively removes silent frames from
the original audio signal.
In terms of result analysis and discussion, the former code allows the user to adjust the relative gains of
different frequency bands in an audio file in real-time. The effectiveness of this technique can be
evaluated by listening to the equalized audio output and comparing it to the original audio signal. The plot
of the original and enhanced audio signals can also be examined to see the effects of the equalization on
different frequency bands.
The second code effectively removes silence from a speech audio signal. The effectiveness of this
technique can be evaluated by listening to the output audio and comparing it to the original audio signal.
The plot of the original and enhanced audio signals can also be examined to see the effects of the silence
removal on the audio signal.
Overall, both codes provide effective techniques for enhancing audio quality and removing unwanted
silence from speech signals. The results obtained from these techniques can be evaluated subjectively by
listening to the output audio and comparing it to the original audio signal, and objectively by analyzing
the plots of the original and enhanced audio signals.

12
CONCLUSION
In this project, we explored two techniques for enhancing the quality of audio recordings:
equalization and silence removal. We implemented these techniques using MATLAB, and
evaluated their effectiveness through a series of experiments and evaluations on various speech
and music recordings.
Our results showed that the equalization technique was effective in improving the clarity and
balance of audio recordings, particularly in the midrange frequencies. The silence removal
technique was also effective in reducing the length of speech recordings, while preserving the
natural pacing and flow of the speech.
The combination of these techniques provides powerful tools for enhancing the quality of audio
recordings, whether for music, speech, or any other kind of sound. By improving the overall
listening experience for users, these techniques can make audio content more enjoyable,
accessible, and understandable.
The potential applications of these techniques in various real-world scenarios, such as
teleconferencing, podcasting, and music production, are significant. The ability to enhance the
quality of audio recordings can have a positive impact on communication, entertainment, and
education.
In conclusion, the equalization and silence removal techniques provide effective and practical
solutions for enhancing the quality of audio recordings, and have the potential to improve the
overall listening experience for users. The success of this project highlights the importance of
audio quality enhancement in various applications, and suggests opportunities for further
research and development in this field.

SAMPLE CODE
For audio quality enhancement using equalization technique:
function graphic_equalizer
% Create a new figure
fig = uifigure('Position', [100 100 400 400]);
fig.Name = 'Graphic Equalizer';

% Define the center frequencies and bandwidths of the equalization bands


frequencies = [500 1000 2000 4000 8000];
bandwidths = [100 200 400 800 1600];
gains = [5 3 1 2 4];

% Create a set of sliders to control the levels of each frequency band


for i = 1:length(frequencies)
slider = uislider(fig);
slider.Position = [50 350-i*40 300 20];
slider.Limits = [-10 10];
slider.Value = gains(i);
slider_callback = @(sld, event) update_audio(sld, event, frequencies, bandwidths);
slider.ValueChangedFcn = slider_callback;
end

% Load an audio file

13
[x, fs] = audioread('.wav');
disp(size(x));

% Function to update the audio when the slider values change


function update_audio(sld, event, frequencies, bandwidths)
gains = get_slider_values();
eq_filter = zeros(size(x));
for i = 1:length(frequencies)
w0 = 2*pi*frequencies(i)/fs;
Q = w0/bandwidths(i);
alpha = sin(w0)/(2*Q);
b0 = 1 + alpha*gains(i);
b1 = -2*cos(w0);
b2 = 1 - alpha*gains(i);
a0 = 1 + alpha/gains(i);
a1 = -2*cos(w0);
a2 = 1 - alpha/gains(i);
b = [b0 b1 b2];
a = [a0 a1 a2];
eq_filter = eq_filter + filter(b, a, x);
end
max_val = max(abs(eq_filter));
eq_filter = eq_filter/max_val;

% Plot the original and enhanced audio signals


t = (0:length(x)-1)/fs;
figure('Name', 'Audio Signal Comparison');
subplot(2,1,1);
plot(t, x);
xlabel('Time (s)');
ylabel('Amplitude');
title('Original Audio Signal');
subplot(2,1,2);
plot(t, eq_filter);
xlabel('Time (s)');
ylabel('Amplitude');
title('Enhanced Audio Signal');

sound(eq_filter, fs);
end

% Function to get the current slider values


function gains = get_slider_values()
gains = zeros(size(frequencies));
for i = 1:length(frequencies)
slider = fig.Children(end-i+1);
gains(i) = slider.Value;
end
end
end

For silence removal from speech:


% Load the audio file
[audioData, sampleRate] = audioread('voice.wav');

% Parameters
frameSize = round(sampleRate * 0.02); % 20ms frame size
overlap = round(frameSize * 0.05); % 50% overlap
threshold = 0.02; % Energy threshold for silence detection

14
% Calculate the number of frames
numFrames = ceil(length(audioData) / (frameSize - overlap));

% Pre-allocate the output audio


outputAudio = [];

% Process each frame


for i = 1:numFrames
% Calculate the start and end indices of the current frame
startIndex = (i - 1) * (frameSize - overlap) + 1;
endIndex = startIndex + frameSize - 1;

% Check if the endIndex exceeds the length of the audio data


if endIndex > length(audioData)
endIndex = length(audioData);
end

% Extract the current frame


currentFrame = audioData(startIndex:endIndex);

% Calculate the energy of the current frame


frameEnergy = sum(currentFrame.^2);

% If the frame energy is above the threshold, add it to the output audio
if frameEnergy > threshold
outputAudio = [outputAudio; currentFrame];
end
end
% Plot the original and enhanced audio signals
t = (0:length(audioData)-1)/sampleRate;
figure('Name', 'Audio Signal Comparison');
subplot(2,1,1);
plot(t, audioData);
xlabel('Time (s)');
ylabel('Amplitude');
title('Original Audio Signal');
subplot(2,1,2);
t2 = (0:length(outputAudio)-1)/sampleRate;
plot(t2, outputAudio);
xlabel('Time (s)');
ylabel('Amplitude');
title('Enhanced Audio Signal');
% Save the output audio
audiowrite('output_audio_no_silence3.wav', outputAudio, sampleRate);

15
REFERENCE
 "Audio Signal Processing and Coding" by Andreas Spanias, Ted Painter, and
Venkatraman Atti
 "Digital Signal Processing: Fundamentals and Applications" by Li Tan and Jean Jiang
 "Speech and Audio Signal Processing: Processing and Perception of Speech and Music"
by Ben Gold and Nelson Morgan.
 "Audio Effects: Theory, Implementation and Application" by Joshua D. Reiss and
Andrew P. McPherson.
 GOOGLE
 DSP TEXTBOOK

16

You might also like