Sunteți pe pagina 1din 4

First Unit: Speach Processing

March 25, 2017

Lab 1
Group: Mark:
Students:

1 Objectives
• Used data acquisition systems for audio processing.
• Design lters with the fdatool from Matlab.
• Process audio signals to reduce noise.

2 Theory
2.1 Nyquist Theorem

Nyquist theorem is a fundamental theorem in way of digitalizing signals. Mainly, it ensures a correct
sampling time Ts to adequately discretize signals. Given a baseband signal with maximum frequency f ,
then

fs ≥ 2f (1)
where fs = 1
Ts is the sampling frequency.

2.2 Additive Noise

A common assumption is to model the noise r(t) as additive signal, so that the signal under consideration
can be express as follows

y (t) = x (t) + r (t) (2)


in general, if x (t) is samples at every Ts steps, the sampled points are

y (nTS ) = [y (Ts ) ; y (2Ts ) ; · · · ; y (nTs )] (3)


or considering a simplied version of Eq. 3

y [n] = [y [1] ; y [2] ; · · · ; y [n]] (4)

1
2.3 FFT

Fast Fourier Transform (FFT) is a tool to map time domain signals, like voice or audio signals, to the
frequency domain. It is dened as:
N
(5)
X 2πj
X (k) = x [n] e− N (n−1)(k−1)

n=1

or its inverse transform IFFT


N
1 X
(6)
2πj
x [n] = X (k) e N (n−1)(k−1)
N
k=1

Example 1: generate some seconds of a two-tone signal with frequencies f1 = 110Hz and f2 = 220Hz
with mixing coecients w1 = 0.5 and w2 = 1, i.e.:

x(t) = w1 x1 (t) + w2 x2 (t) (7)


where x1 (t) and x2 (t) are sinusoidal signal at frequencies f1 and f2 , respectively. Use fs = 44.1KHz .
Command lines in Fig. shows how to the F F T (x(t)) by employing fft command from Matlab.

L = length(x);
NFFT = 2^nextpow2(L);
Xf = fft(x,NFFT)/L;
%
f = fs/2*linspace(0,1,NFFT/2+1);
Xf_one = Xf(1:NFFT/2+1);
%
plot(f,2*abs(Xf_one))
xlabel('f(Hz)')
ylabel('|X(f)|')

Figure 1: Sequence of command in Matlab to plot FFT of x(t) in logarithmic scale.

2.4 Filters

The general form of a lter is given by


b0 + b1 z −1 + b2 z −2 + · · · + bq z −q
H (z) = (8)
1 + a1 z −1 + a2 z −2 + · · · + ap z −p
where z = e−jw and b = [b0 ; b1 ; · · · ; bq ] and a = [a0 ; a1 ; · · · ; ap ] are the lter coecients.
In the context of audio processing, lters are systems that help us with elimination of noise or unwanted
frequencies. They are classied in:
• Low pass lters
• High pass lters
• Band pass lters
• Notchband lters
There are several ways of designing lters, however this lab guide focuses on next -most common- lters:
• Butterworth
• Chebyshev I

2
• Chebyshev II
• Eliptic

Every lter presents dierent characteristics resume in Tab.

Order n Rice
Butterworth high No
Chebyshev I moderate in pass band
Chebyshev II moderate in rejected band
Elliptic low both
Table 1: Main features of lters.

2.4.1 Filter design

Matlab oers several ways of designing lters, among them, the fdatool is the easiest way to congure
the lter and obtain the lter coecients (Fig. 2)

Figure 2: fdatool GUI from Matlab.

Once the lter coecients are obtained, the filter command can be used.

3
3 Practical
3.1 AWGN

1. Add AWGN noise r(t) to signal x(t)

r(t) ∼ N µ, σ 2 (9)


where µ and σ 2 are the mean and variance of the signal which should be set to 0 and 0.2, respectively.
2. Plot the spectral power distribution of new signal

y(t) = x(t) + r(t) (10)


3. Design a LPF with cut frequency set to fc = 300Hz and make a comparison of both the x(t) and
y(t). Comment the observed dierences in time domain and frequency domain.
(a) Filters to be used are those listed in Section 2.4.

3.2 Voice

1. Record some seconds of your voice.


2. Plot the baseband representations of the recorded signal.
3. Select an adequate cuto frequency and listen and compare to with the unltered one.
4. Add Gaussian noise at dierent powers, represent it in the frequency domain.
5. Select and adequate cuto frequency, play the ltered voice and comment the dierences.
6. Add a tone with frequency outside the bandwidth of your voice and design a lter to eliminate such
signal.
7. Add a tone with a frequency inside the bandwidth of your voice and design a lter to eliminate such
signal.

S-ar putea să vă placă și