0% found this document useful (0 votes)
68 views13 pages

ECEA108L Expt5 Castillo

This document describes an experiment using MATLAB to record and analyze voice audio data. The experiment records voice audio, plots the raw audio data, and applies various filters including low-pass, high-pass, band-pass and stop filters. The filtered audio is analyzed by plotting the frequency spectrum. The results show how each filter modifies the voice audio by removing or emphasizing different frequencies.

Uploaded by

Syd ECE Three
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views13 pages

ECEA108L Expt5 Castillo

This document describes an experiment using MATLAB to record and analyze voice audio data. The experiment records voice audio, plots the raw audio data, and applies various filters including low-pass, high-pass, band-pass and stop filters. The filtered audio is analyzed by plotting the frequency spectrum. The results show how each filter modifies the voice audio by removing or emphasizing different frequencies.

Uploaded by

Syd ECE Three
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Experiment 5

Syd T. Castillo
Leonardo Valiente
ECEA108L – B15
17/01/2021
Castillo, Syd T. 17/01/2021

Fs = 11025;
CASTILLO = audiorecorder(Fs, 16, 2, -1);
disp('Start Speaking.')
recordblocking(CASTILLO, 5);
disp('End of Recording.')
data = getaudiodata(CASTILLO);
plot(data)
play(CASTILLO)
audiowrite('SydCastillo.wav',SydAudio,Fs)

I never thought that we can use MATLAB to record our voices. Moreover,
we can see the frequency to better visualize the frequency of your
voice.
Castillo, Syd T. 17/01/2021

complex = fft(SydAudio,512);
freq = (0:255)/256*Fs/2;
plot(freq,abs(complex(1:256)),'r')
xlabel('Frequency'), ylabel('Amplitude')

Syntax:
Fs = 11025;
[B,A] = fir1(6,[1000]/(Fs/2),'low')
zplane(B,A,'r')
lines = findall(gcf,'type','line');
lines(1).Color = 'r';
lines(2).Color = 'r';
lines(3).Color = 'r';
[a,n] = impz(B,A)
stem(n,a,'r')
[h g] = freqz(B,A)
plot(g*Fs/(2*pi),abs(h),'r')
Castillo, Syd T. 17/01/2021

Syntax:
Fs = 11025;
LPFD = filter(B,A,SydAudio)
LPFM = fft(LPFD,512);
freq = (0:255)/256*Fs/2;
plot(freq,abs(LPFM(1:256)),'r')
xlabel('Frequency'), ylabel('Amplitude')
Castillo, Syd T. 17/01/2021

My voice in the audio output signal becomes easier to understand.

Syntax:
Fs = 11025;
[B,A] = fir1(6,[2500]/(Fs/2),'high')
zplane(B,A)
lines = findall(gcf,'type','line');
lines(1).Color = 'r';
lines(2).Color = 'r';
lines(3).Color = 'r';
[a,n] = impz(B,A)
stem(n,a,'r')
[h g] = freqz(B,A)
plot(g*Fs/(2*pi),abs(h),'r')
Castillo, Syd T. 17/01/2021

Adding the high frequency filter only generates the frequencies at


2500 Hz and the lower frequencies cannot be seen in the waveform.
Syntax:
Fs = 11025;
HPFD = filter(B,A,SydAudio)
HPFM = fft(HPFD,512);
freq = (0:255)/256*Fs/2;
plot(freq,abs(HPFM(1:256)),'r')
xlabel('Frequency'), ylabel('Amplitude')
Castillo, Syd T. 17/01/2021

The sound of my voice is much more softer and deeper than the original
sound.

Syntax:
Fs = 11025;
[B,A] = fir1(15,[2000 3000]/(Fs/2),'bandpass')
zplane(B,A)
lines = findall(gcf,'type','line');
lines(1).Color = 'r';
lines(2).Color = 'r';
lines(3).Color = 'r';
[a,n] = impz(B,A)
stem(n,a,'r')
[h g] = freqz(B,A)
plot(g*Fs/(2*pi),abs(h),'r')
Castillo, Syd T. 17/01/2021

The wave form shows an increase approximately 1.1 kHz and decreases
approximately 2.5 kHz.
Syntax:
Fs = 11025;
BPFD = filter(B,A,SydAudio)
BPFM = fft(BPFD,512);
freq = (0:255)/256*Fs/2;
plot(freq,abs(BPFM(1:256)),'r')
xlabel('Frequency'), ylabel('Amplitude')
Castillo, Syd T. 17/01/2021

The audio that I hear has more background noise the voice’s volume is
decreasing.

Syntax
Fs = 11025;
[B,A] = fir1(20,[800 2200]/(Fs/2),'stop')
zplane(B,A)
lines = findall(gcf,'type','line');
lines(1).Color = 'r';
lines(2).Color = 'r';
lines(3).Color = 'r';
[a,n] = impz(B,A)
stem(n,a,'r')
[h g] = freqz(B,A)
plot(g*Fs/(2*pi),abs(h),'r')
Castillo, Syd T. 17/01/2021

The waveform is now inverted at the frequency plot. It shows


distortion at specific frequency but still holds relationship.
Syntax:
Fs = 11025;
SBFD = filter(B,A,SydAudio)
SBFM = fft(SBFD,512);
freq = (0:255)/256*Fs/2;
plot(freq,abs(SBFM(1:256)),'r')
Castillo, Syd T. 17/01/2021

The audio is becoming deeper and unwanted frequencies are filtered and
generates a distinct sound.
Proof:
Castillo, Syd T. 17/01/2021
Castillo, Syd T. 17/01/2021

You might also like