Professional Documents
Culture Documents
close all;
clear all;
clc;
%%%%%%%annotions%%%%%%%
%word that is recorded containing the phoneme
word='diksha';
%reading of the wave file
phonemewav=wavread('F:\Diksha\recording\diksha.wav');
%start time of the phoneme
start_time_secs=0;
%size of the portion taken from the phoneme to use in fft
part_size_variable=0.18;
%offset of where to take the phoneme from
start_of_part=0.02;
%generalizations
wordfilename=strcat(word,'F:\Diksha\recordings\diksha.wav');
phonemefilename=strcat(word,'PHONEME','F:\Diksha\recordings\diksha.wav');
%to get the fs and the sequence
[s,fs]=wavread('F:\Diksha\recording\diksha.wav');
%to create the timer vector
t=0:1/fs:(length(s)-1)/fs;
%plot(t,s)
%%
%to do the spectrogram plots
%narrowband spectrogram
%size of the window
T=0.025;
%to make the computation efficient thats why we take in powers of 2
N=2^round(log2(T*44100));
%defining the hamming window
win=hamming(N);
figure(1)
%saves(A,word,'bmp')
%for plotting the waveform
subplot(311);
plot(t,s)
ylabel('x(t)');
xlabel('times,s');
title('diksha');
%narrow band spec
subplot(312)
specgram(s,N,fs,win,floor(0.97*N));
xlabel('time,s');
ylabel('f,Hz');
title('Narrowband spectrogram');
%wideband spectrogram
subplot(313)
specgram(s,N,fs,hamming(N/4),round(0.9*N/4));
xlabel('time,s');
ylabel('f,Hz');
title('Wideband spectrogram');