Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all
- close all
- clc
- N=1;
- xk = [0:1/100:1];
- % I funkcja rosnaca
- x = [0:N/100:N/4-0.01];
- x1=(4/N)*x;
- % II funkcja malejaca
- x = [N/4:N/100:3*N/4-0.01];
- x2 = (-4/N)*x+2;
- %III funkcja rosnaca
- x = [3*N/4:N/100:N];
- x3 = (4/N)*x-4;
- %wektor
- xn = [x1,x2,x3];
- subplot(3,1,1);
- plot(xk, xn)
- hold on
- grid on
- %wspolczynniki ak
- f = fft(xn);
- %podpunkt b
- fabs = abs(f);
- f_ampl=abs(f);
- f_faz=angle(f);
- %f_faz=angle(f).*(f_ampl>10^-10);
- subplot(3,1,2);
- bar(f_ampl);
- title('Widmo amplitudowe')
- subplot(3,1,3);
- bar(f_faz);
- title('Widmo fazowe sygnalu')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement