You are on page 1of 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