Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs = 8000;
- time = 5;
- t = 0 : 1 / fs : time - 1 / fs;
- y1 = randn(time * fs, 1);
- y1 = transpose(y1);
- figure
- subplot(4, 2, 1)
- plot(t, y1)
- title('Szum gaussowski')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- z = moc(y1, 0.999);
- subplot(4, 2, 2)
- plot(t, z)
- axis([0 5 0 2])
- title('Szum gaussowski - obwiednia mocy, alfa=0.999')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 3)
- plot(t, sin(2 * pi * 1000 * t))
- title('Sygnał sinusoidalny o stałej częstotliwości')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- axis([-inf inf -2 2])
- z = moc(sin(2 * pi * 1000 * t), 0.999);
- subplot(4, 2, 4)
- plot(t, z)
- axis([0 5 0 1])
- title('Sygnał sinusoidalny o stałej częstotliwości - obwiednia mocy, alfa=0.999')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 5)
- y1 = chirp(t, 0, 5, 1000);
- plot(t, y1)
- title('Sygnał sinusoidalny o zmiennej częstotliwości')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- axis([-inf inf -2 2])
- z = moc(y1, 0.999);
- subplot(4, 2, 6)
- plot(t, z)
- axis([0 5 0 1])
- title('Sygnał sinusoidalny o zmiennej częstotliwości - obwiednia mocy, alfa=0.999')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 7)
- [y, fs] = audioread('MyVoice8kHz.wav');
- t = 0 : 1/fs : length(y) / fs - 1 / fs;
- plot(t, y);
- title('Sygnał mowy')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- z = moc(y, 0.999);
- subplot(4, 2, 8)
- plot(t, z)
- axis([0 5 0 0.1])
- title('Sygnał mowy - obwiednia mocy, alfa=0.999')
- xlabel('Czas [s]')
- ylabel('Moc')
- fs = 8000;
- time = 5;
- t = 0 : 1 / fs : time - 1 / fs;
- y1 = randn(time * fs, 1);
- y1 = transpose(y1);
- figure
- subplot(4, 2, 1)
- plot(t, y1)
- title('Szum gaussowski')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- z = moc(y1, 0.99);
- subplot(4, 2, 2)
- plot(t, z)
- axis([0 5 0 2])
- title('Szum gaussowski - obwiednia mocy, alfa=0.99')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 3)
- plot(t, sin(2 * pi * 1000 * t))
- title('Sygnał sinusoidalny o stałej częstotliwości')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- axis([-inf inf -2 2])
- z = moc(sin(2 * pi * 1000 * t), 0.99);
- subplot(4, 2, 4)
- plot(t, z)
- axis([0 5 0 1])
- title('Sygnał sinusoidalny o stałej częstotliwości - obwiednia mocy, alfa=0.99')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 5)
- y1 = chirp(t, 0, 5, 1000);
- plot(t, y1)
- title('Sygnał sinusoidalny o zmiennej częstotliwości')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- axis([-inf inf -2 2])
- z = moc(y1, 0.99);
- subplot(4, 2, 6)
- plot(t, z)
- axis([0 5 0 1])
- title('Sygnał sinusoidalny o zmiennej częstotliwości - obwiednia mocy, alfa=0.99')
- xlabel('Czas [s]')
- ylabel('Moc')
- subplot(4, 2, 7)
- [y, fs] = audioread('MyVoice8kHz.wav');
- t = 0 : 1/fs : length(y) / fs - 1 / fs;
- plot(t, y);
- title('Sygnał mowy')
- xlabel('Czas [s]')
- ylabel('Amplituda')
- z = moc(y, 0.99);
- subplot(4, 2, 8)
- plot(t, z)
- axis([0 5 0 0.2])
- title('Sygnał mowy - obwiednia mocy, alfa=0.999')
- xlabel('Czas [s]')
- ylabel('Moc')
Advertisement
Add Comment
Please, Sign In to add comment