Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = 0 : 2 * pi / 32 : 2 * pi;
- y = sin(t)
- subplot(3, 2, 1)
- stem(y);
- xlabel('Numer probki');
- ylabel('Amplituda');
- title('Re(y)');
- axis([1 32 -1 1])
- subplot(3, 2, 2)
- stem(imag(y))
- xlabel('Numer probki');
- ylabel('Amplituda');
- title('Im(y)');
- axis([0 33 -1 0])
- subplot(3, 2, 3)
- fourier = 2 * fft(y) / length(y);
- stem(real(fourier))
- xlabel('Numer pasma częstotliwościowego');
- ylabel('Amplituda');
- title('Re(fft(y))');
- axis([0 34 -0.05 0.1])
- subplot(3, 2, 4)
- stem(imag(fourier))
- xlabel('Numer pasma częstotliwościowego');
- ylabel('Amplituda');
- title('Im(fft(y))');
- axis([0 34 -1 1])
- subplot(3, 2, 5)
- stem(abs(fourier))
- xlabel('Numer pasma częstotliwościowego');
- ylabel('Magnituda');
- title('Moduł(fft(y))');
- axis([0 34 0 1])
- subplot(3, 2, 6)
- stem(angle(fourier))
- xlabel('Numer pasma częstotliwościowego');
- ylabel('Faza [pi x rad]');
- title('Phase(fft(y))');
- axis([0 34 -4 4])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement