SHARE
TWEET

Untitled

a guest Jun 12th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %Łukasz Ibron, I03
  2. %PM13P
  3. %Cw 3 - Szereg Furiera
  4. clear all,close all
  5. format short
  6.  
  7. t=(0:999)/1000;
  8. ft=[1-cos(pi*t(1:500)),zeros(1,500)];
  9.  
  10.  
  11. figure(1)
  12. plot(t,ft),grid
  13. xlabel('t')
  14. ylabel('f(t)')
  15. title('zad.3')
  16.  
  17.  
  18. f0=pi-2/2*pi
  19. k=(1:20).';
  20. fk=(-1).^k./(pi*(4*k.^2-1))+j*(((4*k.^2-1)*(-1).^k+1)./(2*pi*k.*(4*k.^2-1)));
  21. disp('   k       |Fk|     arg{Fk}   [deg]')
  22. [k, abs(fk),angle(fk)*180/pi]
  23.  
  24. x=f0;
  25. figure(2)
  26. for l=1:20
  27.    x=x+2*abs(fk(l))*cos(l*2*pi*t+angle(fk(l)));
  28.    plot(t,ft,t,x,'-m'),grid
  29.    xlabel('t')
  30.    ylabel('f(t)')
  31.    title(['ku=u ',num2str(l)])
  32.    pause
  33. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top