Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Simulink Implementation of Human Voice Filter

Anil Bezawada
Department of Electronics and Communication Engineering,
SRM University – AP, Amaravati, Andhra Pradesh, India
E-mail: Bezawada_anil@srmap.edu.in

Saikiran Puranam
Department of Electronics and Communication Engineering,
SRM University – AP, Amaravati, Andhra Pradesh, India
Email: puranam_sai@srmap.edu.in

Shyam Prasad Kunapareddy


Department of Electronics and Communication Engineering,
SRM University – AP, Amaravati, Andhra Pradesh, India
E-mail: Kunapareddy_shayam@srmap.edu.in

Abstract: In this paper, we present a novel block-based filter design approach using Simulink. The filter is designed to
attenuate human voice from a song to extract only the music from the song. The uniqueness of the design lies in its simplicity
and can be implemented without any prior coding knowledge unlike implementations found in the literature. Various pre-built
filters available in Simulink are used in our block-based approach to finding the optimum filter that suits our needs. Also, the
different filter parameters are tuned and refined as per our audio input. To further clean up the resultant audio output various
windowing techniques – Butterworth, Hamming, Hanning are introduced. It turned out that band stop filter in combination
with Butterworth windowing provides the best results with ‘whisper-like’ to no human voice present in the audio output. We
also perform FFT to input and output audio file to note the change in the spectrum between the signals which helps in better
optimizing various band stop filter parameters such as pass and stop frequency, the order of the filter. A comparative study
with the different parameters and remark about the quality of the output audio is presented in the form of a table. The
optimized design parameters are found to provide good results for both voices (Male, Female) and their respective spectrums
are presented for comparison. However, it is found that design has to be slightly altered if the set of instruments used for a
song varied enormously compared to the reference audio file.

Keywords: Voice filtering, Simulink, Filter design, Windowing, Stopband.

1. Introduction
Filtering is a term in digital signal processing used for filtering a message signal or an audio signal and
to reduce a particular frequency range for given signal. The main reason here for filtering a signal is to
reduce and smooth out high-frequency noise associated with it like noise. In signal filtering there are
many uses made for this and those are used in the areas such as speech processing, audio noise
detection in forensic. As we know the term filtering means that cleaning of surrounding noise from the
original voice or from a set of sounds. The best example is creating music with instruments.

As discussed, the main purpose of this paper is filtering of human voice which includes that to clean
the voice from its disturbance like music plays etc.., There are many types in voice filtering. One of the
methods is known as inverting. So, let us know what inverting function does, the inverting function
process is to flip an audio sample (like horizontal zero lines, will become negative, and negative
samples will become positive) just reversing their polarity.

We can get a question that the voice filtering in the inverting process includes effect in the sound. But
the answer was the inverting function which usually does not affect our audio but can be used mostly

1
for cancellation of voices. But what if we apply inverting function to tracks like one track to another.
Here it is mixed with the non-inverting track that has same audio as identical, if identical the audio
which is identical will cancel out.

Let us know about the band stop filter. When it comes to band stop filters it is used in many types of
filtering but here, we used in the filtering of human voice. When this filter is in use, we place the
frequency in middle of our audio range are reduced by this filter. This filter is proposed because all
audio of us humans are in between some interval of signal like middle of signal(interval). Another such
filters are low pass, high pass and band pass filters these filters will also help us to decrease the
particular frequency of signal but the disadvantage is they unable to reduce frequency in middle of a
signal frequency range. Here we also used 2 filters like bandpass and high pass and compared the
outputs, the detailed information regarding these two filters is represented below and the differences
are shown in the below table.

Table 1 Comparison of Bandpass, Band stop, High pass and their operation

Band stop Bandpass High pass


The main use of the band stop filter is it allows to This bandpass filter say in receiver help to allow A high-pass filter has an effectively cuts out the
pass all types of the frequency such as zero to its the signals with range of frequencies selected frequency response of a mic below a certain set
first cut off range frequency point say F1 is a pass which will be heard or decoded, while point, allowing only the frequencies above this
above it called second cut-off preventing the signals from the unwanted point to pass through as the audio signal
It blocks the higher frequencies. frequencies.

Another use or application is in the rejection of a This filter helps in optimize the SNR ratio and High-pass filters removes the excess and the
specific signal from a range of signals in the sensitivity of its receiver. unwanted energy low end which degrades audio
communication systems signal if not removed.

Here we shall know how to create the band stop filter. This filter band-stop is discussed how to design
for our desired result with help of Matlab and Simulink. Windowing a process used for the required
design. This is required for Butterworth, Chebyshev filters etc. But here the result is seen that they
both have minimal change which is not considerable, so not necessary a comparison between them.

1.1. Windowing
It is a process of taking a small subset taking from a larger data set like small signal from our human
voice, because of easy processing and analysis. A simple method of taking the rectangular kind
window simply involves us to make shorten the time of duration of the dataset available before and
after the window, by not changing or it not modifying the context of our window. Here we have used
one song which is recorded in dubbing theatre and we have separated the noise and the human voice
for which the results are also given and analysed the output graphs.

2. Human Voice Filtering


As we all know human voices are classified into types, like different voice of male voice and female
voice even animals. The difference between the two types is their voice tone. The tone prepared in
such a way that is altered because to have one purpose. That purpose uses us to filter voice and also to
change pitch and frequency.

The average rate of frequency that voice of human has about 110Hz for both voices. Most important
thing here to be remembered is we have to take male and female voice based on averages. Averages in
the sense taking them equally for an example (if we are considering 20male voices it must be equally
mixed with female audio in the same number. Here separation of pitch is involved, and some of the

2
key spectral features on spectrum of the sound are separated and kept in limits. The extracted key
features are assigned to in time and then the remaining components like Harmonics, Time, Respective
frequencies etc..,. By this the pitch and voices are obtained and reconstructed. Generally, a human
voice ranges with extreme low frequency (ELF) that is <3KHz.

3. Filters
Here in this paper, we have implemented the analysing Audio by using three filters these are used to
filter the voice or an audio by different frequencies they are: Band stop Filter, Bandpass Filter, High
pass Filter. These Filter designed using filter development section in MATLAB as given in algorithm
in this section we have seen about the band stop filter and also comparing the same audio frequencies
and analysing the spectrum of phase response and magnitude for band and high pass filter.

3.1. Band Stop Filter


The main objective undertaking this filter(Band Stop) because of fact that different frequencies of
different voices of human. As we know the frequency of both voices are in between 0HZ TO
20HZ.The main purpose of the band stop filter is it allows to pass all the frequencies from zero to its
first cut off range point F1, a pass all those points of frequency called second cut off. It blocks the
frequencies which are higher. The image attached shows the relation between normalized out power
and frequency. It is attached just in order to let know where the band stop filter rejects the higher
frequency. It’s also known as band rejection filter.

Figure 1(a),1(b) Band Stop Filter [1] and its


Specifications [2]

3.2. Other Filters


Here as discussed in section [3] we can also
do this filtering with the other filters [1].
Results show that only band stop has given us
the optimal results for the voice sample taken
and the all-other filters have to be enhanced for better results. The techniques for enhancement as well
as some results are produced for the filters.

Figure 2. Band Pass Filter Specifications

4. Filter Enhancement
The enhancement techniques for all:
Note: If we want to implement in this voice filtering, we have to follow this algorithm for easily
 In the implementation we develop a program, by using simple FFT (fast Fourier transform) to
create both input and the output for required frequency spectrum.
 Take different numbers for numbering the requirements of the filter designs each time the
experiment is done.

3
 Play the respective audio file and note the result each time by numbering when the experiment is
done.
Check the taken frequency spectrum as reference to input and output for reference for each time the
experiment is done. Repeat steps until the optimal value obtained. This is either enhancing or creating
a filter in Matlab with the desired values. The below shown figures are: Band pass, High pass, Band
Stop which are been designed and simulated in MATLAB Simulink in spite of coding which could be
very much easy to understandable.

These all filters are seen or realised in same way but they have the specifications as seen in Fig [3a],
[3b] and [3c]

Figure 3a,3b,3c: Block design of filters in MATLAB Simulink of Band Stop, Band Pass, High pass with audio
multimedia as input and spectrum analyser as output.

5. Butterworth Windowing
The main aim of choosing Butterworth windowing because to give a idea on how the filtering is done
for the music given by instrumental applications and is done by using the windowing designs of a band
stop filter. Here the butter worth is designed by two independent parameters known as 3-db cut-off
frequency fc and filter order. Also Order this filter (Butterworth) will parameters and controls
bandwidth and the sidelobe or local maxima reduction (lessening the amount of force) of the
Butterworth window.

The important thing here is the cut-off frequency here written as bandwidth by half. Here band width
of window represents to the two-sided frequency from negative to positive, whereas we know that cut-
off frequency of a filter refers to only one side positive frequency. This windowing is created as a
function program.

6. Algorithm to Design Filters and Butterworth Windowing

4
This paper is written on the basis of general applications of forensic and we have done this project in
MATLAB Simulink instead of coding here we have designed a protocol for filtering of human voice
by using Band-Stop Filter. Firstly, we have given an input in Audio multimedia file by going to
Simulink library browser select audio toolbox and in that we will have source and sink source for input
and sink for output in source we can put two kinds of input one from mic which we can speak and the
audio records and second one is audio multimedia file which we can .Wav audio files in that. The next
step is designing a filter for this go to apps select filter designer app after opening select the kind of
filter and then IIR or FIR and then Butterworth filter and set the frequencies were the
filter can read the audio and then design the filter. After designing the filter put Output either by
spectrum Analyzer which shows in graphical way or an audio speaker where we can hear filtered
voice.

The frequencies of the Band-Stop filter should be Fs 48000Hz, Fpass1-20Hz, Fstop1-100Hz, Fpass2-
4000Hz, Fstop2-3500Hz these are the accurate values which we take to read and play the audio
perfectly. The filter filters and Reads and writes the audio and plays the filters audio. The output is
heard through either an audio speaker or spectrum analyser. After that we have to generate a code for
our design. For that we need to go for model design parameters and code generation, select language to
either C or C++ and select apply option right click the screen and press ctrl+v to generate code
automatically for our project. Here we can generate spectrum as well as the audio splitters by using the
sink functions in the library functions either by band stop or band pass filters or any desired filter.

7. Result and Discussion


Here in this paper, we have implemented in the Simulink using blocks. This project doesn’t need any
type of coding. The algorithm which was given as a reference in this paper is useful for the coding
part. In this we have compared in between 3 filters those are bandpass, band stop, high pass. The
output which we got was different. The output which we got was completely different, there are no
similarities in between these 3 filters. So here the we used 3filters so the application of those are
limited to only presented experiments. So, we can take both voices for result calculation and check the
outputs and listen whether the voice or music or disturbance is filtered or not. As we can see the below
comparison of the human voice filtering from an audio showing different frequencies.

Figure 4: Analysed spectrum waveform of filtered voice from a disturbed audio through High pass filter

5
Figure 5:
Analysed
spectrum of
same audio filtered through Band Stop filter

Figure 6: Analysed spectrum of the same audio filtered through Band Pass Filter

8.Conclusion
By doing this experiment we have seen results about filter designed which also designed and
simulated in MATLAB have given the desired results for human filtering of voice helping for
optimization as well as for comparing. Here both stop-band and band-stop filter’s design’s are shown
to work for both voices. We also learnt how to create block diagrams in spite of going into complex
algorithms which takes high time complexity. Here both male voice and female voices are taken and
the filtering is done. The song duration which we took was 20seconds.In this way we have did the
experiment and concluded that the voice filtering is done (disturbance is removed and clear voice is
heard).

Conflict of Interest
The authors make sure that there’s is no struggle to claim for this publication.

Acknowledgement
We express our vote of thanks to Dr. Anirban Ghosh who is Assistant Professor from the department of ECE for all his
inputs and comments and huge support for us in execution of this project.

6
References
[1] B. C. Baker (2015), “Bandstop Filters and the Bainter Topology,” Analog Applications Journal, Texas
Instruments Incorporated.
[2] D. E. Re, J. J. M. O’Connor, P. J. Bennett, and D. R. Feinberg, “Preferences for Very Low and Very High
Voice Pitch in Humans,” PLoS ONE, 7(3), art. no. e32719, 2012.
[3] Devendra K. Chaturvedi (2010) Modeling and Simulation of Systems Using MATLAB and Simulink CRC
Press. Florida.
[4] W. Meiniar, F. A. Afrida, A. Irmasari, A. Mukti and D. Astharini, "Human voice filtering with band-stop
filter design in MATLAB," 2017 International Conference on Broadband Communication, Wireless Sensors and
Powering (BCWSP), Jakarta, Indonesia, 2017, pp. 1-4, doi: 10.1109/BCWSP.2017.8272563.

You might also like