Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Zana Sulaiman MohammedAli Simo--ECE Grade 2
- %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
- clear all; %clearing all data from
- clc; %Workspace
- %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
- [Y,Fs]=audioread('Zana.wav'); %reading the audio file %step -3-
- Y=Y(:,1); %Framaing the signal wave %step -4-
- L=0.03*Fs; %
- R=0.005*Fs; %
- X=buffer(Y,L,R); %making the buffer %step -5-
- m=length(Y); %
- STE=sum(X.^2); %calculating Energy %step -6-
- z=sum(abs(sign(X)-sign(X-1))); %calculating Z-crossing%step -7-
- z = z / abs(max(z));
- STE = STE / abs(max(STE));
- %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
- subplot(3,1,1); %ploting the 2 waves %step -6-
- plot(Y); %
- xlabel('Time in Second'); %
- title('Speech Wave'); %
- grid on; %
- subplot(3,1,2); %
- plot(STE); %
- xlabel('Time in Second'); %
- title('Short Term Energy'); %
- grid on; %
- %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
- subplot(3,1,3); %Ploting Z-crossing %step -7-
- plot(z); %
- title('Zero Crossing Wave'); %
- grid on; %
- %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement