Advertisement
stiansjogren

komteo

Apr 27th, 2017
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. % ****************************************************
  2. % filter length from peak to end (half of total filter length
  3. T = 0.01;
  4. % roll-off factor
  5. beta = 0.5;
  6. % oversampling ratio
  7. osr = 128;
  8. % sample interval
  9. ts = T/osr;
  10. % window length in cycles
  11. M = 10;
  12. % time index
  13. t = [0:ts:M*T].';
  14. % position of singularity points in time
  15. tsingidx = osr/(2*beta)+1;
  16. % filter coefficients
  17. g1 = sin(t/T)./(t/T).*cos(pi*beta*t/T);
  18. g2 = (1-(2*beta*t/T).^2);
  19. g = g1./g2;
  20. % fix singularity points in function
  21. g(1) = 1;
  22. g(tsingidx) = pi*beta/2*sin(1/(2*beta));
  23. % mirror and fold pulse to get symmetric coefficients
  24. rc = [g(end:-1:2);g];
  25. time = [-t(end:-1:2);t];
  26. % ****************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement