Nitin400

QUESTION-Function for Even and Odd Decomposition of Real Sig

Jan 2nd, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. function [xe, xo, m] = evenodd(x,n)
  2. % Real signal decomposition into even and odd parts
  3. % xe =1/2[x[n] + x[−n]]
  4. % xo =1/2[x[n] − x[−n]]
  5. % xe= even part of sequence x over n
  6. % xo =odd part of sequence x over n
  7. n = -1:2
  8. x = [2 5 6 8]
  9. [xe,xo] = sigfold(x)
  10. subplot(2,1,1)
  11. stem(n,xe)
  12. subplot(2,1,2)
  13. stem(n,xo)
  14. function [xe,xo] = sigfold(x)
  15. xf = fliplr(x)
  16. xe = 1/2*(x + xf)
  17. xo = 1/2*(x - xf)
  18. end
Add Comment
Please, Sign In to add comment