1 Objectives: First Unit: Speach Processing
1 Objectives: First Unit: Speach Processing
Lab 1
Group: IET7-1 Mark:
Students:
MARIO VALENCIA ESPINO
CARLOS QUISPE NUÑEZ
1 Objectives
• Used data acquisition systems for audio processing.
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)
1
where fs = Ts is the sampling frequency.
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 defined as:
N
X 2πj
X (k) = x [n] e− N (n−1)(k−1) (5)
n=1
Example 1: generate some seconds of a two-tone signal with frequencies f1 = 110Hz and f2 = 220Hz
with mixing coefficients w1 = 0.5 and w2 = 1, i.e.:
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)|’)
2.4 Filters
The general form of a filter 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 filter coefficients.
In the context of audio processing, filters are systems that help us with elimination of noise or unwanted
frequencies. They are classified in:
• Low pass filters
• High pass filters
• Band pass filters
• Notchband filters
There are several ways of designing filters, however this lab guide focuses on next -most common- filters:
• Butterworth
• Chebyshev I
2
• Chebyshev II
• Eliptic
Order n Rice
Butterworth high No
Chebyshev I moderate in pass band
Chebyshev II moderate in rejected band
Elliptic low both
Once the filter coefficients are obtained, the filter command can be used.
3
3 Practical
3.1 AWGN
1. Add AWGN noise r(t) to signal x(t) = sin(2πf1 t) with f1 = 100Hz
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)
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 differences in time domain and frequency domain.
(a) Filters to be used are those listed in Section 2.4.
3.2 Voice
1. 1 Record some seconds of your voice.
4
Figure 4: Leer el audio y sacar transformada
1. 3 Select an adequate cuto frequency and listen and compare to with the unfiltered one.
Se diseño un filtro paso bajo con una frecuencia de corte de 1000 para filtrar la señal de voz grabada.
5
Figure 6: Codigo para filtrar la señal
6
Figure 7: Señal filtrada y señal original
*La señal original esta siendo cortada desde los 1000 Hz gracias al LPF construido.
Se aplicara el proceso anterior para ver el comportamineto del filtrado pero ahora con ruido.6
7
1. 5 Select and adequate cuto frequency, play the filtered voice and comment the differences based on
the ploting in both domains time and frequency.
1. 6 Add a tone with frequency f1 outside the bandwidth of your voice (e.g. BW 2KHz) and design
a filter to eliminate such signal.
Se agregará un señal nueva a la señal de voz para luego con el uso de los filtros poder eliminarla
8
Figure 11: Señal de voz y tono nuevo en la frecuencia
9
Figure 13: Señal de tono y voz es filtrada en la frecuencia
1. 7 Add a tone with a frequency f2 inside the bandwidth of your voice and design a filter to eliminate
such signal.
Se incluira el tono extra en una parte del espectro que solape con la señal original de la voz para despues
poder eliminar cierta señal con el uso de un filtro sin alterar mucho la señal original de la voz.
10
Figure 15: Codigo para agregar el tono en la banda de la señal de voz
La señal es sometida a un filtro rechaza banda porque solo se se necesitaba cortar una parte del espectro
ya que el tono agregado esta en los 600 Hz.
11
Figure 17: Diseño del filtro rechaza banda
4 Conclusiones
• Los filtros son una herramienta para el tratamiento y procesado de señales, con estos podemos
rechazar,pasar o cortar partes de la señal que solo queremos tener, existen variedades de filtros y
cada uno de estos tienen comportamientos distintos.
• Al añadir ruido a una señal es un caso cotidiano real, al momento de transmitir el ruido esta siempre
presente, las señales transmitidas nunca estan completamnete limpias, para lo cual se usan los filtros
para dar soluciones.
12