Académique Documents
Professionnel Documents
Culture Documents
1. ITRODUCTIO ..................................................................................................................1
1.1 Channel Equalization ..........................................................................................................1
1.2 Types ...................................................................................................................................2
1.2.1 Linear Equalizer ......................................................................................................2
1.2.2 Decision Feedback Equalizer ..................................................................................2
1.2.3 Adaptive Equalizer ..................................................................................................3
2. THEORY .................................................................................................................................4
2.1 The Problem Statement .......................................................................................................4
2.2 System Identification ..........................................................................................................4
2.3 Algorithm ............................................................................................................................6
3. RESULT ..................................................................................................................................7
3.1 Actual Input Signal for Sxx .................................................................................................7
3.1.1 Zero Phase Filter .....................................................................................................7
3.1.2 Linear Phase Filter ................................................................................................10
3.2 Different Signal for Sxx .....................................................................................................11
3.2.1 Zero Phase Filter ...................................................................................................12
3.2.2 Linear Phase Filter ................................................................................................13
3.3 Approximated Sxx .............................................................................................................14
3.3.1 Zero Phase Filter ...................................................................................................15
3.3.2 Linear Phase Filter ................................................................................................16
4. COCLUSIO .....................................................................................................................18
4.1 Concise Result ..................................................................................................................18
4.2 Future Work ......................................................................................................................18
4.3 Experience .........................................................................................................................18
5. REFERECE ........................................................................................................................19
APPEDIX ..................................................................................................................................20
1. ITRODUCTIO
In audio processing, equalization is the process of changing the frequency envelope of a sound.
In passing through any channel, temporal/frequency spreading of a signal occurs. Etymologically,
it means to correct, or make equal, the frequency response of a signal. The term "equalizer" is
often incorrectly applied as a general term for audio filters. These are in fact general all-purpose
all
filters, which can be arranged to pproduce
roduce the effect of low pass, high pass, band pass and band
stop filters. Only when these filters are arranged so as to reverse the effects of the internal
circuitry on sound output, are they operating as equalizers.
The purpose of an equalizer is to reduce the ISI as much as possible to maximize the probability
of correct decisions.
1
1.2 Types
1.2.1 Linear Equalizer
a) Zero forcing equalizer – In such type of equalizers, it removes the complete ISI
without taking
ng in consideration the resul
resulting
ting noise enhacement.
enhacement Using this, there is a
substantial increment of the noise power
power.
It is a simple
imple nonlinear equalizer which is particulary useful for channel with severe
amplitude distortion. It uses desicion feedback to cancel the interferfence from symbols
which have already have been detected. The basic idea is that if the values of the symbols
already detected are known (past decisions are assumed correct), then the ISI contributed
by these symbols can be canceled exactly.
2
1.2.3 Adaptive Equalizers
This type of equlaizers adapt the coefficients to minimize the noise and intersymbol
interference (depending on the type of equalizer) at the output.
b) Training Mode: To make equalizer suitable in the initial acqusition duration, a training
signal is needed. In this mode of operation, the transmitter generates a data symbol
sequence known to the receiver.
Once an agreed time has elapsed, the slicer output is used as a training signal and the
actual data transmission begins.
3
2. THEORY
In an Energy Density Spectrum technique of system identification, we compute the input signal
x[n] from Energy Density Spectrum of input signal Sxx(݁௪ ) and that of output signal Syy(݁௪ ).
This spectrum can be evaluated by taking the DTFTs of the autocorrelation sequence rxx[l] of
input sequence x[n] and the autocorrelation sequence ryy[l] of output sequence y[n].
y[n] Considering
a stable LTI discrete time system with an impulse response h[n],
And our application, the input signal x[n] is not known, this system
system can be identified by
computing the autocorrelation of the output signal y[n] defined by,
4
ஶ
ݎ௬௬ ሾ݈ ሿ ൌ ݕሾ݊ሿݕሾ݊ െ ݈ሿ
ୀିஶ
ஶ ஶ ஶ
ஶ ஶ ஶ
ஶ ஶ
where, ܵ௬௬ ሺݖሻ is the z – transform of ݎ௬௬ ሾ݈ ሿ. On the unit circle, the above equation reduces to
ଶ
ܵ௬௬ ൫݁ ௪ ൯ ൌ หܪ൫݁ ௪ ൯ห ܵ௫௫ ሺ݁ ௪ ሻ
From, the above relation, the autocorrelation of the output signal can provide only the magnitude
response of the system but not the phase response.
5
2.3 Algorithm
Here, we only have the filtered sample. Hence we kind of approximate Sxx values, which is the
average of various speech samples considered for our experiment. Hence, we find the
autocorrelation of the sequence y, and then pass it through FFT block to get the Frequency
response of ryy as Syy. Then we perform division of Syy and Sxx to get |H(z)|2. Then we perform
the square root of it and divide it to Y which is the DTFT of output sample to get frequency
components of regenerated
erated input sample. Then we perform Inverse DTFT by passing it through
IFFT block to get the regenerate input sample in time domain.
As discussed before, by this approach, we lose the phase information being added by the filter,
hence we need to make approximation
roximation on filter characteristics so as to minimize θH, resultantly
θx ≈ θy. Hence in a nutshell, approximations being made are listed below.
6
3. RESULTS
For our experimentation purpose, we ran three type of simulation each with zero and linear phase
which are described in detail below.
Here we passed through a length 11 zero-phase FIR lowpass filter designed using the Remez
exchange algorithm. The matlab code for designing this filter is as follows:
The impulse response is returned in linear-phase form, so it must be left-shifted (N-1)/2 samples
to make it zero phase.
Figure 3.1: Impulse response and frequency response of a length 11 zero-phase FIR lowpass filter. Here the
frequency response is real because the filter is zero phase. Also plotted (in dashed lines) are the desired passband
and stopband gains.
7
Figure 3.2 shows the amplitude and phase responses of the FIR filter designed by remez. The
phase response is zero throughout the passband and transition band. However, each zero-crossing
in the stopband results in a phase jump of π radians, so that the phase alternates between zero and
π in the stopband. This is typical of practical zero-phase filters.
Fig3.2 : Amplitude response and phase response of the length 11 zero-phase FIR lowpass filter in Fig.3.1.
We passed our original input sample through the zero phase filter generated, and here’s the
spectral analysis of the original and filtered sample showing the energies at lower frequencies are
kept intact while that of in higher frequencies are removed.
8
We compute sqrt(Syy/Sxx) which is the magnitude response of the unknown filter. By doing this,
we loose phase information and hence it remains 0 as shown in graph with small glitches in
middle.
Fig 3.4 Magnitude and Phase Response of the Zero Phase filter
After we got the filter response, we tried to regenrate x by dividing y by magnitude response of
filter obtained and did an inverse DTFT on that. Through this, we could successfully regenerate
original sample, and energy spectrum looks exactly same as per the original sample as per the
spectral analysis.
9
3.1.2 Linear Phase Filter
For this, we used the same filter code without shifting it by (N-1)/2. Here is the spectrum of input
and filtered sample showing the energy in the higher frequency area are removed.
The maginitude and phase response (almost zero as expected) obtained are as follows
Fig 3.7 Magnitude and Phase Response of the Linear Phase filter
10
We could regenrate the input sample but had some ringing sound. In the spectral analysis, we see
some energy at higher frequency (blue spots) are missing in the regenerated sample.
For this part of simulation, we took a completely different sample to approximate Sxx. Below is
the spectral analysis of the original sample and approximated sample.
Fig 3.9 Spectrum of Original Signal and Used Signal for Sxx
11
3.2.1 Zero Phase Filter
Below is the magnitude and phase response which we could recover (some what corrupted).
Fig 3.10 Magnitude and Phase Response of the Zero Phase filter
After regeneration of the input sample, we found it similar to the input sample, but with lot of
noise being added in the background. From the spectral analysis, we see the input and
regenerated sample have similar enery spectrum but have lot of distortion in higher frequencies.
Fig 3.11 Spectrum of Original Signal and Regenerated Signal (Zero-Phase) (Using different signal for Sxx)
12
3.2.2 Linear Phase Filter
We repeated the same process considering a Linear Phase Filter Channel, and got a corrupted
magnitude and phase response for the filter.
Fig 3.12 Magnitude and Phase Response of the Linear Phase filter
The regenerated sample sounded much like the original sample but with lot of noise being added
in background. Also, from the spectral analysis, the energy spectrum looks quite similar with lot
of distortion in higher frequency area.
Fig 3.13 Spectrum of Original Signal and Regenerated Signal (Linear-Phase) (Using different signal for Sxx)
13
3.3 Approximated Sxx
Here we took a complete different input sample, and used three samples which was the same
speech but spoken by different speaker and at different timing. Here is the spectral analysis of
three samples with energy spectrum similar but different in sense of timing and frequency.
To approximate Sxx, we took the average of the frequency components of their autocorrelation
values. This is because Sxx values for a human speech are nearly same, hence taking an average
of different samples.
14
3.3.1 Zero Phase Filter
This is the spectrum of original sample, after being passed through low pass zero phase filter,
which enerdies removed at higher frequencies.
Here’s the magnitude and phase response of the filter. It looks less corrupted and more close to
the original filter response as obtained in 3.1.1.
Fig 3.17 Magnitude and Phase Response of the Zero Phase filter
15
The regenerated sample sounded less noisy than that of 3.2.1. Also the energy spectrum is more
close to the original at lower frequencies.
Fig 3.18 Spectrum of Original Signal and Regenerated Signal (Zero-Phase) (Using Average of 3 samples for Sxx)
When passed through Linear Phase , it removes the energy at higher frequency.
16
The magnitude response of the filter appears more closer to the original one that 3.1.2 than 3.2.2
Fig 3.20 Magnitude and Phase Response of the Linear Phase filter
The regenerated sample sounded less noisy than that of 3.2.2 case. Also through the spectral
analysis, enery spectrum at lower frequency are nearly same and less noisy than 3.2.2.
3.21 Spectrum of Original Signal and Regenerated Signal (Linear-Phase) (Using Average of 3 samples for Sxx)
17
4. COCLUSIO
From the work done, we can have better approximation algorithms so as the regenerated sample
is more close both in terms of magnitude and phase, closer to the original sample. Also, as this
approach of System Identification has a major contraint of losing the phase response of the filter,
this technique cannot be used for general case, and hence lot of approximation on the filter
specification has to be done. For other filter like that of IIR filters such as Butterforth or
Elliptical filter, this technique could be used to recover the magnitude response of the sample, so
if we have a technique to predict the phase modification being added by the filter, we can recover
the original sample.
4.3 Experience
Working directly upon the filter characteristics, modifying its properties, playing with sound
samples, analyzing the sound spectrum and comparing various tradeoffs affecting equalization
characteristics gave us a through insight upon a real world problem. Also it gave us an
experience of implementing the theoritical aspect of Digital Signal Processing over an actual
application. Hence, we are kind of thankful to everyone especially Prof. Dan Ellis and TA Wei
Jiang, whose constant guidance and motivation saved our work to go into pitfalls.
18
5. REFERECES
[3] http://en.wikipedia.org/wiki/Equalization
[4] Blind System Identification and Channel Equalization of IIR Systems without Statistical
Information, Signal Processing, IEEE Transactions on Acoustics, Speech, and Signal
Processing, Erwei Bai and Minyue Fu.
19
APPEDIX
Code for 3.1.1, 3.1.2, 3.2.1, 3.2.2
num = 512*64;
a = 0; %Start from the beginning (a=0), a can be
0~77482
[x,r] = wavread('mssp3.wav'); %ORIGINAL Sound
[x2,r] = wavread('mssp2.wav'); %Another Sound
x=x(a+1:a+num); % shorten the original sound(110250) into
(32768)
x2=x2(a+1:a+num);
N = 11; % filter length - must be odd
b = [0 0.1 0.2 0.5]*2; % band edges
M = [1 1 0 0 ]; % desired band values
h = remez(N-1,b,M); % Remez multiple exchange design
hh = h(6:N); % Shift (N-1)/2=5 samples to make h zero-phase
hh(7:11) = 0;
for i = 1 : num1
if (syy(i) == 0)
XX(i) = 999999999999999;
XX2(i) = 999999999999999;
else
%|ܪሺiሻ| ଶ = syy(i)/sxx(i); XX(i)=Y(i)/H(i)
XX(i) = Y(i)*sqrt(abs(sxx(i)/syy(i)));
XX2(i)= Y(i)*sqrt(abs(sxx2(i)/syy(i)));
end
end
for i = 1 : num1
if (sLyy(i) == 0)
LXX(i) = 999999999999999;
20
LXX1(i) = 999999999999999;
else
%%|ܪሺiሻ| ଶ = syy(i)/sxx(i); XX(i)=Y(i)/H(i)
LXX(i) = LY(i)*sqrt(abs(sxx(i)/sLyy(i)));
LXX1(i) = LY(i)*sqrt(abs(sxx2(i)/sLyy(i)));
end
end
xx = ifft(XX,num1);
xx2 = ifft(XX2,num1);
Lxx= ifft(LXX,num1);
Lxx1= ifft(LXX1,num1);
% Zero-Phase Filter case
soundsc(x,r); %Original Sound
soundsc(y,r); %Original Sound passed through Zero-Phase Filter
soundsc(xx,r); %Regenerated signal by using original signal as estimated x
soundsc(xx2,r); %Regenerated signal by using other signal as estimated x
% Linear-Phase Filter case
soundsc(x,r); %Original Sound
soundsc(Ly,r); %Original Sound passed through Linear-Phase Filter
soundsc(Lxx,r); %Regenerated signal by using original signal as estimated x
soundsc(Lxx1,r);%Regenerated signal by using other signal as estimated x
num = 512*64;
[x,r] = wavread('sf1_cln.wav'); %ORIGINAL Sound
[x1,r] = wavread('sf2_cln.wav'); %BASE Sound
[x2,r] = wavread('sf3_cln.wav'); %BASE Sound
x=x(1:num);
N = 11; % filter length - must be odd
b = [0 0.1 0.2 0.5]*2; % band edges
M = [1 1 0 0 ]; % desired band values
h = remez(N-1,b,M); % Remez multiple exchange design
hh = h(6:N); % Shift (N-1)/2=5 samples to make h zero-phase
hh(7:11) = 0;
% Pass it through the filter
y = filter(hh,1,x); % Zero Phase
Ly = filter(h,1,x); % Linear Phase
% Autocorrelation
rxx=xcorr(x(1:num)); %AutoCorrelation: ORIGINAL Sound
rxx1=xcorr(x1(1:num)); %AutoCorrelation: BASE Sound
rxx2=xcorr(x2(1:num)); %AutoCorrelation: BASE Sound
ryy=xcorr(y);
rLyy=xcorr(Ly);
rxysize = size(rxx);
num1 = 2^ceil(log2(rxysize(1))); %make num into even Ex.65535 into 65536
% Do FFT to get frequency response of autocorrelation
sxx = fft(rxx,num1);
sxx1= fft(rxx1,num1);
sxx2= fft(rxx2,num1);
sxx3= (sxx+sxx1+sxx3)/3; %Average the original and base sound as estimated
Sxx
syy = fft(ryy,num1);
sLyy = fft(rLyy,num1);
21
Y = fft(y,num1);
LY =fft(Ly,num1);
% Zero-Phase Filter
for i = 1 : num1
if (syy(i) == 0)
XX(i) = 999999999999999;
else
%|ܪሺiሻ| ଶ = syy(i)/sxx(i); XX(i)=Y(i)/H(i)
XX(i) = Y(i)*sqrt(abs(sxx3(i)/syy(i)));
end
end
% Linear-Phase Filter
for i = 1 : num1
if (sLyy(i) == 0)
LXX(i) = 999999999999999;
else
%%|ܪሺiሻ| ଶ = syy(i)/sxx(i); XX(i)=Y(i)/H(i)
LXX(i) = LY(i)*sqrt(abs(sxx3(i)/sLyy(i)));
end
end
xx = ifft(XX,num1);
Lxx= ifft(LXX,num1);
% Zero-Phase Filter case
soundsc(x,r); %Original Sound
soundsc(y,r); %Original Sound passed through Zero-Phase Filter
soundsc(xx,r); %Regenerated signal by using average spectrum as Sxx
% Linear-Phase Filter case
soundsc(x,r); %Original Sound
soundsc(Ly,r); %Original Sound passed through Linear-Phase Filter
soundsc(Lxx,r); %Regenerated signal by using average spectrum as Sxx
22