Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //najlepiej zrobić funkcje generującą, aby pamietała sinusoide
- x=linspace(0,2*pi,64);
- y=sin(x);
- subplot(5,1,1);
- stem(y)
- z=fft(y);
- subplot(5,1,2);
- stem (abs(z))
- subplot(5,1,3);
- stem(real(z));
- subplot(5,1,4);
- stem(imag(z));
- subplot(5,1,5);
- stem(angle(z));
- //2
- N = 64;
- n = 0:1:N-1;
- y1 = cos((2*pi*n/N) + (pi/4));
- y2 = 0.5*cos((4*pi*n)/N);
- y3 = 0.25*cos((8*pi*n/N) + (pi/2));
- y4 = y1 + y2 + y3;
- subplot(4,2,1)
- plot(y1);
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,2)
- plot(y2);
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,3)
- plot(y3);
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,4)
- plot(y4);
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,5)
- stem(abs(fft(y1)));
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,6)
- stem(abs(fft(y2)));
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,7)
- stem(abs(fft(y3)));
- ylabel('Amplituda');
- xlabel('Numer próbki')
- subplot(4,2,8)
- stem(abs(fft(y4)));
- ylabel('Amplituda');
- xlabel('Numer próbki')
- //3
- zrobić tak dla każdej z zadania 2
- x=linspace(0,2*pi,64);
- y=sin(x);
- fourier=fft(y);
- ifourier=ifft(fourier);
- stem(ifourier)
- //4
- N = 64;
- n = [0:1:N];
- k = 2;
- o = 2*pi*k/N;
- fi = 0;
- nawias=i*o*n + fi;
- funkcja=exp(nawias);
- fourier=fft(funkcja)
- rzeczywista=real(fourier)...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement