%Project 2.
%ATTIQUE REHMAN
%(2839-5921)
%EE 416, Digital Signal Processing.
%Due On October 26th .Friday 5.00PM
%********************************************************
%****************The Start Of The Project****************

a0=wavread('sample.wav')    %Here it read the sample.wav file
a1=a0'                      %Converting to a Column Matrix
a2=a1(1:128);               %1st 128 points seleced
a3=[a2,zeros(1,394)];       %Zero Padding(Resolution Increased)
A1=fft(a2);                 %F.T Of Fn. Before Being Zero Padded  
A2=fft(a3);                 %F.T After Being Zero Padded
A1mag=abs(A1);              %Here Magnitude of the non-zero padded F.T is taken   
length(A1mag)               
length(A1mag)
A1ag=phase(A1);             %Phase of Non-Zero Padded F.T is being executed
A2mag=abs(A2);              %Now Magntude of the Zero Padded F.T is being Taken
A2ag=phase(A2);             %Phase of Zero Padded F.T.
figure(1);
subplot(2,2,1)
plot(A1mag);
title('Magnitude With No Zero padding');
xlabel('0 to 128 of N');
ylabel('A1mag Function');

subplot(2,2,2)
plot(A1ag);
title('Phase With no Zero Padding');
xlabel('0 to 128 of N');
ylabel('A2mag Function');

subplot(2,2,3)
plot(A2mag);
title('Magnitude With Zero Padding');
xlabel('0 to 128 of N');
ylabel('A2mag Function');


subplot(2,2,4)
plot(A2ag);
title('Zero Padding Phase');
xlabel('0 to 128 of N');
ylabel('A1ag Function');

%w=kaiser(128,X1mag);
%figure(2);
%plot(w.*pi/512);

%******Thankyou. It Was Nice Working On This One.********





