MINI MINI MANI MO

Path : /home/dude/public_html/
File Upload :
Current File : /home/dude/public_html/lv1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<p><br />
%Askisi 1</p>
<p>Fs = 100; <br />
  n = 1:15;<br />
  x = 2*sin(10*pi*n/100) + 4*cos(20*pi*n/100) + 10*cos(30*pi*n/100) + 2*sin(90*pi*n/100);<br />
  plot(n/Fs, x);<br />
  figure;<br />
  stem(n, x);</p>
<hr />
<p><br />
% Askisi 1b</p>
<p>n = 1:1000;<br />
  x = 2*sin(10*pi*n/100) + 4*cos(20*pi*n/100) + 10*cos(30*pi*n/100) + 2*sin(90*pi*n/100);<br />
  X = fft(x,2048); <br />
  f = ((0:1024)/2048)*Fs; <br />
  plot(f,abs(X(1:1025))); <br />
  subplot(2,1,1)<br />
  plot(n/Fs, x); <br />
  subplot(2,1,2)<br />
  f = ((0:1024)/2048)*Fs; <br />
  plot(f, 20*log10(X(1:1025)));<br />
</p>
<hr />
<p><br />
% Askisi 1c</p>
<p>n = 0:50;<br />
  xn = cos(0.1*pi+0.4*n); <br />
  stem(n,xn);<br />
</p>
<hr />
<p><br />
% Askisi 1d</p>
<p>n = 1:11; x = 6*cos(60*pi*n/350); M = 3;<br />
  xdown = myfunc(x,M);<br />
  xd = downsample(x,M);<br />
  figure;<br />
  subplot(3,1,1)<br />
  stem(x)<br />
  subplot(3,1,2)<br />
  stem(xdown)<br />
  subplot(3,1,3)<br />
  stem(xd)</p>
<hr />
<p>[sig,fs] = wavread('Male.wav');<br />
  N1 = round(0.25*fs);<br />
  N2 = round(0.6*fs);<br />
  a1 = 0.65; a2 = 0.9;<br />
  mechosig = filter([1 zeros(1,N1-1) a1 zeros(1,N2-N1-1) a2], 1, sig);<br />
  <br />
  n = 50000:53000;<br />
  subplot(2,1,1)<br />
  plot(n, sig(n))<br />
  title('arxiko shma');<br />
  subplot(2,1,2)<br />
  plot(n, mechosig(n), 'r')<br />
title('shma me hxo');</p>
<hr />
<p>Nfft = 1024;<br />
  f = ((0:Nfft/2)/Nfft)*fs;<br />
  S = fft(sig, Nfft);<br />
  MS = fft(mechosig, Nfft);<br />
  figure; subplot(2,1,1) plot(f, 20*log10(abs(S(1:Nfft/2+1))));<br />
  title('fasmatiko periexomeno arxikou shmatos');<br />
  subplot(2,1,2)<br />
  plot(f, 20*log10(abs(MS(1:Nfft/2+1))), 'r');<br />
title('fasmatiko periexomeno shmatos me hxw');</p>
<hr />
<p>noechosig = filter(1, [1 zeros(1,N1-1) a1 zeros(1,N2-N1-1) a2], mechosig);</p>
<p>Error = sig-noechosig;<br />
SNR = 20*log10( (norm(sig))/(norm(Error)) );</p>
<hr />
<p>[sig,fs] = wavread('Voice 2.wav');<br />
  z = zc(sig, fs);<br />
  [voiced, unvoiced] = dive(sig, z, 200, 1);<br />
  &macr;gure;<br />
  plot(sig);<br />
  hold on; plot(unvoiced, 'g'); hold o&reg;;<br />
legend('voiced regions','unvoiced regions',2);</p>
<hr />
<p>[p,t] = pitch(sig, fs, 70, 160);<br />
  figure;<br />
  subplot(2,1,1);<br />
plot(sig);</p>
<p>xlabel('samples');<br />
  title('signal in time');<br />
  subplot(2,1,2);<br />
  plot(t,p);<br />
  xlabel('samples');<br />
  ylabel('Hz');<br />
title('pitch');</p>
<p>median(p)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p></p>
</body>
</html>

OHA YOOOO