You are on page 1of 1

('Zad 2.

1');

%wczytanie sygnału
[x, fs] = wavread('mwi06cegi.wav');
N = length(x);
t = 0:1/fs:(N-1)/fs;

%wyświetlenie sygnału
figure(1);
subplot (2,1,1);
plot(t,x); grid on;
xlabel("t[s]");
ylabel("x(t)");
title("Sygnal wczytany");

%przedstawienie modułu DFT


[f,Y] = analiza_dft(x, fs);
subplot (2,1,2);
plot (f,abs (Y)); grid on;
title ("Modul Y(f)");
xlabel ("dyskretna os czestotliwosci [Hz]");
ylabel("|Y(f)|");

%decymacja
[ty, y] = decymacja(x,t,100);

%wyświetlenie sygnału
figure(2);
subplot (2,1,1);
plot(ty,y); grid on;
xlabel("t[s]");
ylabel("y(t)");
title("Sygnal po decymacji");
%przedstawienie modułu DFT
[f1,Y1] = analiza_dft(y, fs/100);
subplot (2,1,2);
plot (f1,abs (Y1)); grid on;
title ("Modul Y1(f)");
xlabel ("dyskretna os czestotliwosci [Hz]");
ylabel("|Y1(f)|");

You might also like