• Sign Up
• Login
• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Jun 12th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. clear all , close all
2. format short
3.
4. t = (0:999)/1000;
5. ft =[-4*t(1:500).^2+4*t(1:500) , ones( 1,499 ),zeros(1,1)];
6. figure(1)
7. plot ( t , ft ) , grid
8. title ( 'Zad 10' )
9. xlabel ( 't' )
10. ylabel ( 'f(t)' )
11.
12. %f0=0.834; - dla tego jest idealnie
13. %f0=0.833;
14. f0=0.833;
15. %f0=(-1/pi^2*0^2)+j*((pi^2*0^2-2+2*(-1)^0)/(2*pi^3*0^3));
16. k = (1:20 ).' ;
17.
18.
19. fk=-1./(pi^2*k.^2)+j*((pi^2*k.^2-2+2*(-1).^k)./(2*pi^3*k.^3));
20. %fk=-1./(pi^2*k.^2)+j*((pi^2*k.^2-2+2*(-1).^k)./(2*pi^3*k.^3));
21. %fk=-1./(pi^2*k.^2)+j*((pi^2*k.^2-2+2*(-1).^k)./(2*pi^3*k.^3));
22. disp ( ' k |Fk| arg (Fk) [ deg ] ' )
23. [k , abs( fk ) , angle( fk ) *180/pi ]
24. x=f0 ;
25. figure (2)
26.
27. % l to L
28. for l =1:20
29.     x=x+2*abs(fk(l))*cos(l*2*pi*t+angle(fk(l))) ;
30.     plot ( t,ft,t,x,'-m') , grid
31.     txt=num2str(l);
32.     title(['k = ',txt])
33.     xlabel('t')
34.     ylabel('f(t)')
35.     pause
36. 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.

Top