MATLAB Code Section 1, d
MATLAB Code Section 1, d
t_offset= 0.65;
s1= y(t_offset * fs : ((t_offset + 0.03) * fs) - 1);
temp= zeros(16,1);
s1= cat(1, temp, s1);
s1= cat(1, s1, temp);
S= fft(s1);
S= S(1 : length(s)/2);
Smag= abs(S);
SmagdB= 20 .* log10(Smag);
Sphi= atan(imag(S)./real(S));
f= linspace(0, fs/2, length(SmagdB));
t= linspace(t_offset, t_offset + 0.03, length(s1));
subplot 311
plot(t, s1)
axis tight
xlabel('Time (sec)')
ylabel('Amplitude ')
title('Voiced Vowel /a/, 0.65 to 0.68 seconds ')
subplot 312
plot(f, SmagdB)
axis tight
xlabel('Freq (Hz)')
ylabel('dB')
title('Magnitude Response ')
subplot 313
plot(f, Sphi)
axis tight
xlabel('Freq (Hz)')
ylabel('radians')
title('Phase Response ')