Advertisement
Guest User

Untitled

a guest
Nov 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.80 KB | None | 0 0
  1. N=9
  2. fgc=200+N*50
  3. fp=900+N*100
  4. Tp=1/fp
  5. t=0:Tp:0.1-Tp
  6. %y=tf([1.43],[1,1.4256,1.5162])
  7.  
  8.  
  9. wga=0.5
  10. wgc=2*pi*fgc
  11.  
  12.  
  13. A=wga*(tan(wgc*Tp/2))^(-1)
  14.  
  15.  
  16. A1=c+b+1.5162
  17. A2=2*b-2
  18. A3=1+b-c
  19. L=[1.43 2.86 1.43]
  20. M=[(A*A+14256*A+1.5162),(-2*A*A+2*1.5162),(A*A+1.4256*A+1.5162)]
  21. z=tf([1.43 2.86 1.43],[(A*A+14256*A+1.5162),(-2*A*A+2*1.5162),(A*A+1.4256*A+1.5162)])
  22. [h,w]=freqz([1.43 2.86 1.43],[(A*A+14256*A+1.5162),(-2*A*A+2*1.5162),(A*A+1.4256*A+1.5162)])
  23. subplot(2,1,1)
  24. plot(w*fp/(2*pi),abs(h))
  25. subplot(2,1,2)
  26. semilogy(w*fp/(2*pi),abs(h))
  27. grid on
  28.  
  29. syg=N*sin(2*pi*50*t)+(N/2)*sin(2*pi*(fgc+100)*t);
  30. sygt=filter(L,M,syg);% przepuścić sygnał przez filtr
  31.  
  32. figure;
  33. plot(t,syg)
  34. figure;
  35. plot(t,sygt)
  36. grid on
  37. sygf=fft(sygt);
  38. %zobaczyć jak się zmieni przepust częstotliwości
  39. % to samo dla filtru 3-rzędu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement