Você está na página 1de 4

An improvement of the output SNR of an assistive listening device

using crosscorrelation
Alejandro J. Uriz, Jorge Casti neira Moreira
CONICET - Communications Lab
National University of Mar del Plata
Mar del Plata, Argentina
E-mail: ajuriz@conicet.gov.ar
Pablo Ag uero, Juan C. Tulli, Esteban Gonz alez
Communications Lab
National University of Mar del Plata
Mar del Plata, Argentina
E-mail: pdaguero@.mdp.edu.ar
AbstractThere are many people suffering from hearing
impairments. The high cost of assistive listening devices leaves
out of reach for many people a technological solution. The main
goal of this work is to present a noise reduction algorithm imple-
mented in a low cost hearing aid device, which through digital
signal processing techniques can get the basic functionality of a
high-end assistive listening device. Objective experiments were
performed to analyze the performance of the system.
Keywordsspeech processing; hearing aid device; crosscor-
relation; dsPIC;
I. INTRODUCTION
Hearing impairments are a condition that affect an impor-
tant percentage of the society. Several techniques have been
developed to assist people with hearing impairments. Such
techniques have been used to design several kinds of assistive
devices, for instance, headsets. Some of these devices are
developed by Widex [1]. This company offers several types
of products, from analog headsets (in some cases only a
x-gain amplier) up to devices based on digital signal
processors, which are capable of obtaining better results
than the analog devices. Actual devices allow to perform
tasks like voice compression, noise reduction and dynamic
equalization, among others. The most important contribution
of this kind of devices is the potential solution for each
particular hearing impairment condition by customizing it
to a particular user.
A vital feature to improve the performance of an assistive
listening device is the signal to noise ratio (SNR). This
paramenter is the relation between the level of a desired
signal to the level of background noise, also known as the
ratio of signal and the noise power.
There are several algorithms to improve the SNR of a
signal. One of the most widely used approaches is the
singular values decomposition (SVD) method [2], [3]. This
technique decomposes a signal to obtain its singular values.
Then considers that the largest singular values are associated
to the desired signal, while the smallest singular values are
related to noise. Thus, the signal is reconstructed using the
largest eigenvalues. Consequently, the reconstructed signal
has less noise than the original. The main limitation of this
technique is that to obtain the eigenvalues it is the necessity
of a large matrix representation of the signal to obtain the
SVD. Thus, a considerable number of instructions and a
signicant amount of memory are required to apply this
method. On the other hand, noise reduction techniques based
on Wavelets[4] use a domain transformation which involves a
large number of instructions. But, when limitations due time
and memory usage appear, a reasonable choice to improve
the SNR is the cross-correlation algorithm [5], which also
operates in the time domain. A similar approach was used
in Takahashi et al. [6] to determine the direction of arrival
of a signal on a microphone-array using a low-cost hardware
based on dsPIC devices.
The goal of this paper is to implement a technique
to improve the output signal to noise ratio of a digital
assistive listening device, which is implemented in a low
cost digital signal processor. Algorithms are implemented
in a DSP device from Microchip. The chosen device is the
dsPIC33FJ128GP802 [7].
The paper is organized as follows. Section II describes the
most important features of digital hearing assistive devices.
Section III presents the developed system. Section IV depicts
the algorithm used to improve the SNR of the system.
Finally, Section V summarizes the conclusions of the work
and provides future research lines.
II. ASSISTIVE LISTENING DEVICES AVAILABLE
There are two families of hearing assistance devices. The
rst one involves analog assistive devices, which generally
only amplify a frequency range of the spectra. This is an
economical solution, but it is limited to a little group of
users. On the other hand, digital assistive listening devices
are the best solution to people with hearing impairments.
These solutions are based on digital signal processors, which
process the sounds to be perceived by a person with a specic
hearing impairment. The main disadvantage of this kind of
assistive devices is their price. For example a high-end digital
assistive listening device cost is around US$4400. The main
features of a hearing aid of that family are:
Audibility extender. This is the most important func-
tionality. It allows the user to hear sounds spectrally
placed into the impaired frequency band.
Adaptive directional system. In noisy environments, it
eliminates noise from the front region of the user, im-
proving the perception of voice in these environments.
In the next section, a system capable of implementing
the most relevant features of an assistive listening device
is presented.
2012 Andean Region International Conference
978-0-7695-4882-1/12 $26.00 2012 IEEE
DOI 10.1109/Andescon.2012.42
125
2012 Andean Region International Conference
978-0-7695-4882-1/12 $26.00 2012 IEEE
DOI 10.1109/Andescon.2012.42
147
III. ASSISTIVE LISTENING DEVICE DEVELOPED
The main goal of the proposed digital assistive listening
device is to process sounds that are perceived by a person
with a hearing impairment, so they can be heard more
naturally. The most relevant features of the implemented
device are listed below:
Antialiasing lter. This stage was implemented using
an integrated 8
th
order elliptic Sallen-Key lter. The
stop frequency was established in 8kHz.
Automatic gain control (AGC). It employes a micro-
controller to acquire the audio signal and applies the
AGC algorithm. Then, the obtained information is used
to control a voltage controlled amplier which adjusts
the level of the signal that is acquired by the analog-to-
digital converter of the digital signal processor.
Digital signal processor. The digital signal processor
used in this project is the dsPIC33FJ128GP802[7].
A more detailed description of the implemented system
can be seen in Uriz et al. [3].
In this work, the audibility extender was implemented
using the SPINC function [8]. Once the system was im-
plemented, full processing times were registered using a
f
sampling
=16.288kHz. The acquisition time is 15.72ms and
the processing time is 3.97ms. This difference occurs because
AD and DA converters use DMA, thus tasks run in parallel,
so the total processing time of the system is regarded as the
greatest of them. Another aspect to consider is the amount
of necessary RAM, 34 percent, and program memory is 4
percent. There is a limitation due to the amount of available
DMA memory (in this case is fully used). This imposes a
limitation on the maximum performance that can be obtained
from the system.
IV. IMPROVEMENT OF SNR USING
CROSS-CORRELATION
A. Applied Method
In order to maximize the comfort of the user, it is
necessary to maximize the signal to noise ratio (SNR) of
the output signal. There are several methods to improve the
SNR of a signal by means of monoaural techniques[2], [4],
but data memory limitations exist[3]. Hence, due to this
restriction, one of the best methods to improve the SNR is the
cross-correlation algorithm [5], [6], which allows to improve
the SNR by using two monoaural systems as an array of
microphones. In this case, the cross-correlation algorithm
is used to improve the SNR of the synthesized audio. The
system is based on the calculation of the cross-correlation
between the signals acquired by each receptor, in this case
each microphone. Figure 1 shows an scheme of the proposed
array of microphones.
This method is based on the fact that the signal from
the direction
s
arrives at the microphone 1, then travels
a distance and is received by the microphone 2. Since
= D.sin
s
, the direction of arrival is determined using
(1).
Figure 1. Scheme of the array of microphones

s
= sin
1
(
.
D
) (1)
Where is the speed of sound, and the time that the
signal requires to travel the distance . Then, is used to
determine the displacement between signals. Then, one of the
signals is shifted d =

Ts
samples, where T
s
is the sampling
period. In this work, is determined by maximizing the
cross-correlation () (see (2)) between X
1
(t) and X
2
(t),
which are the signals acquired by each microphone.
() =
1
N
N1

t=0
X
1
(t)X
2
(t + ) (2)
Where () is a vector of 2.N 1 elements. Then,
assuming that the signal that arrives to both microphones
is the same, if this maximum value of () coincides
with the center of the obtained vector, both signals were
simultaneously received by the microphones. But, if the
maximum value of the result does not match the center
of the cross-correlation vector, it is possible to conclude
that the signal has arrived with a time difference to
each microphone. The minimum delay (d = 1) between
microphones is established by the sampling frequency of AD
converters, which determines the sampling period T
s
.
Once the resulting cross-correlation vector is obtained,
the distance d =

Ts
between the position of the maximum
and the center of the cross-correlation vector determines the
delay between received signals. Then, this method averages
the signal received by each microphone to improve the
performance of the total received signal. To perform this
operation, it is necessary to shift one of the received vectors
in order to compensate the difference in the arrival time
. Once the signal has been shifted, both signals can be
averaged. With additive white gaussian noise, the resulting
signal has an improvement in the signal to noise ratio.
Figure 2 presents the result of the proposed method for an
array of two microphones. The plot shows the obtained SNR
as a function of the input signal. SNR for the baseline system
using only one microphone is presented in blue line. Then,
in red line, it is shown the resulting output SNR applying
the proposed algorithm for an array of two microphones.
In Figure 2 can be seen that the improvement in the SNR
is 3dB for levels of input noise higher than 0.02Vpp. For
lower values of input noise, the improvement is less evident,
because the noise levels are negligible with respect to the
signal level.
The implementation of the algorithm is presented in detail
in the next subsection.
126 148
0 0.1 Vpp 0.2 Vpp 0.3 Vpp 0.4 Vpp 0.5 Vpp
0
10 dB
20 dB
30 dB
40 dB
SNR[dB] vs Noise [Vpp]


Figure 2. Comparison the SNR for the baseline system (blue) and
for the system proposed (red). For noise levels greater than 0.02Vpp the
improvement in the SNR is 3dB
B. Implementation
The cross-correlation method was presented in the sub-
section IV-A. This algorithm uses the signal received from
multiple receivers (in this case two microphones) to improve
the SNR. It is evident that it is necessary to establish
a communication between the systems. In order to take
advantage of the chosen DSP, this link is established using
the serial peripheral interface (SPI) module [7], [9] of the
dsPIC33FJ128GP802. This is a synchronous serial interface
widely used to communicate several types of periphericals.
Another advantage is the high transfer data rate with a speed
up to 10Mbps, which is a critical factor to obtain a real time
nal system.
In order to carry out the improvement, the next architecture
composed by two systems presented in section III was
dened. The baseline system associated to the right ear
microphone, transmits data via SPI to the baseline system
associated to the left ear microphone. Once the data is
received, the cross-correlation algorithm is applied to the data
acquired by the AD converter of the receptor.
In this conguration, the system frequency of each dsPIC
must be exactly the same. Thus, although each device has
a register <OSCTUN> which allows to tune the system
frequency, the resolution of this control is worse than the
system frequency error of DSPs. Then, both devices need to
use the same oscillator. Thus, an external cristal was used
to generate the clock signal of the master device. The same
signal was used also as external clock signal of the slave
device. A critical consideration must be done to connect
the oscillator to the slave device: the effect of the input
capacitance of the gate where the clock signal is injected.
This capacitance is in the order of 60pF. There is an addi-
tional capacitance due to the shielded cable used to connect
the device, and the equivalent capacitance is around 70pF.
This capacitance affects the system frequency of the master
device. This problem was solved connecting a 8,2pF serial
capacitor with the cable. Then, the resulting capacitance is
reduced and the master clocks operates normally. Figure 3
shows the resulting circuit. Caution must be taken about the
level of input clock signal amplitude to the slave device. An
scheme of the resulting system is presented in Fig. 4.
Once the systems are synchronized and the communication
Figure 3. Equivalent oscillator circuit. The equivalent input capacity of
the gate OSC1 is 60pF, also a 10pF capacitance is generated by the yielded
cable. In order to compensate these capacitances, a serial 8.2pF capacitor
is connected
Figure 4. Implemented architecture. The clock signal of the master device
is used to excite the slave device, this is done to synchronize both devices
is established, the cross-correlation method must be applied
to improve the SNR of the signal. The proposed algorithm
operates using the vector received via SPI and the vector
acquired by the AD converter on the slave device.
In the implemented conguration, the master transmits a
vector of 2.N samples for each frame, (N = 256). The
receiver uses this vector, and the vector of the last 3.N
samples acquired via the AD converter to carry out the
improvement of the SNR on each frame.
Once the data was received, two pointers are dened. The
rst pointer, called p
0
, points to the middle of the acquired
vector, while the second pointer (p
reception
) points to the
sample in the position N/4 of the received vector. The
proposed structure is presented in Fig. 5.
The N rst elements from each pointer are cross-
correlated using the VectorCorrelate() instruction of the C30
Microchip Library [10]. The result of this operation is stored
into a vector of 2N 1 elements. If the maximum value of
this resulting vector is placed in the center of them, then
both signals do not have a delay. But, if a difference of d
samples exist between the center of the resulting vector and
the position of the maximum value, then both signals have a
delay of around = d.T
s
, where T
s
is the sampling period.
A representation of the described registers is shown in Fig.
6.
Figure 5. Representation of the acquired buffer (top), and the received via
SPI buffer(bottom). Pointers p
0
and p
reception
are dened in the desired
positions
127 149
Figure 6. Scheme of the vectors used into the cross-correlation operation.
The N elements that follow the pointer p
0
(top) are correlated with the N
elements that follow p
received
(middle). The resultant vector (bottom), has
a length of 2N 1 elements, and the distance between the center of the
vector and the maximum element d denes the delay between signals
Figure 7. Averaging step. Once determined d, the pointer p
reception
is incremented (or decremented) and the 3.N/2 elements that follow the
pointer p
0
(top), are averaged with the 3.N/2 elements that follow the
pointer p
reception
+ d (bottom). The result is stored in a new vector in
order to save the information required to the next iteration
Once the delay d is established, the pointer p
reception
is
incremented (or decremented) d elements. This displacement
can be in a positive or negative direction, depending on the
result of the cross-correlation. This step is detailed in Fig. 7.
Then, the rst 3.N/2 elements starting in the pointers p
0
and p
reception
+d are averaged, and stored in a new vector,
which is used to synthesize the signal using the TD-OLA
algorithm. Two new pointers p
ODD
and p
EV EN
are dened
in the resulting vector, which point to the start of odd and
even synthesis frames respectively.
Finally, in order to save the received information, 2.N ele-
ments starting from the pointer p
0
are left shifted N elements
to save the past information. Then, a new acquisition starts
from the pointer p
0
, and the procedure is repeated.
C. Experiments
A set of objective experiments were made to test the per-
formance of the system. In the rst experiment the processing
time of each process were measured.
TABLE I
SPI COMMUNICATION TIME, ENHANCEMENT ALGORITHM TIME,
PROCESSING TIME, ACQUISITION TIME FOR THE IMPLEMENTATION OF
THE CROSS-CORRELATION ALGORITHM.
SPI Comm. Enhancement Proc. Acq.
0.82ms 5.5ms 3.97ms 15.72ms
Table I shows that the sum of the SPI communication, the
cross-correlation enhancement algorithm and other involved
times, is lower than the acquisition time. Thus, it is possible
to implement the system in real time.
Since the sampling frequency is 16kHz, and the distance
between microphones is 20cm, the spacial resolution ob-
tained by the system is 8 degrees. Also, in order to verify
the correct implementation of the algorithm, the signal to
noise ratio was measured for several input values of a sine
wave of 1kHz and sustained vowels. The result was an im-
provement of around 3dB in the operating range, by applying
the developed cross-correlation algorithm. Consequently, the
improvement is in agreement with theoretical estimations.
The output SNR obtained by applying the algorithm is 46dB.
Another important factor is the resource utilization for this
implementation. The implementation requires 90% of the
data memory, 15% of the program memory, and the DMA
memory is totally used. Furthermore, there is a remnant of
available program memory. Thus, if it is desired to implement
some additional functionality the algorithms should be re-
designed to take advantage of the available program memory.
V. CONCLUSION
In this work, it was demonstrated that it is possible to
successfully implement the cross-correlation algorithm to
improve the Signal-to-Noise Ratio of the output signal in
a system based on a low cost digital signal processor. In
addition, the obtained improvement is in agreement with
theoretical expectations.
The presented hearing aid system in a low scale of produc-
tion has a material cost of about US$100, while a high-end
commercial device has a nal cost of around US$4400. As a
further work, additional features will be implemented, such
as a zen music generator and a feedback control to prevent
a coupling between the system and other electronic devices.
Finally, it is intended to make improvements to reduce the
size of the device, which is critical for this application.
REFERENCES
[1] Widex Inc. http://www.widex.com/, Lynge, Denmark.
[2] H. G. Gauch, Noise Reduction By Eigenvector Ordinations, Ecological
Society of America, Vol. 63, No. 6, pp. 1643-1649, 1982.
[3] A.J. Uriz, P. Ag uero, J.C. Tulli, E. Gonz alez y J Casti neira, Imple-
mentation of noise reduction algorithms in a hearing aid device based
on a dsPIC. Proceedings of IEEE ARGENCON 2012, 2012.
[4] V. Balakrishnan, N. Borgesa and L. Parchment, Wavelet Denoising
and Speech Enhancement, 2006.
[5] A. K. Tellakula, Acoustic Source Localization Using Time Delay Es-
timation, Degree Thesis. Bangalore, India: Supercomputer Education
and Research Centre Indian Institute of Science, 2007.
[6] S. Takahashi, T. Morimoto, Development of Small-size and Low-
priced Speaker Detection Device Using Micro-controller with DSP
functions. Proceedings of the IMECS, Vol.1, 2011.
[7] Microchip Inc., dsPIC33FJ128GPX02/X04 Data Sheet, High Perfor-
mance 16-bit DSCs. http://www.microchip.com/, 2009.
[8] E. Terhardt, The SPINC Function for scaling of frequency in Auditory
Models. Journal of Acoustic. Vol.77 pp.40-42, 1992.
[9] Microchip Inc., Serial Peripheral Interface (SPI) - dsPIC33F/PIC24H
FRM. http://www.microchip.com/, 2011.
[10] Microchip Inc. 16-Bit Tools Libraries. http://www.microchip.com/,
2005.
128 150

Você também pode gostar