Advertisement
Shekhar777

MATLAB LAB3 EX1

Oct 15th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.43 KB | None | 0 0
  1.  
  2. clc
  3. clear all
  4. close all
  5. N=256
  6. T=pi
  7. omega0=2*pi/T
  8. Ts=T/N
  9. nx=0:1:N-1
  10. tx=0:Ts:(N-1)*Ts
  11. xn=exp(-nx*Ts/2)
  12. figure(1)
  13. plot(tx,xn)
  14. xlabel('n')
  15. ylabel('x(t)=exp(-t/2)')
  16. xlim([0 3.14])
  17. ylim([0 1])
  18. M=10
  19. xn(1)=(exp(-0)+exp(-pi/2))/2
  20. ak=exp
  21. fscoefficients(xn,T,M)
  22. k=0:1:length(ak)-1
  23. [akangle,akmag]=cart2pool(real(ak),imag(ak))
  24. figure(2)
  25. subplot(2,1,1)
  26. stem(k,akmag)
  27. xlabel('k')
  28. ylabel('|a_k|')
  29. title('phase spectra plot')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement