Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. clf;clear all
  2. rzad_filtru=10;
  3. f_gr=60;
  4. fs=600;
  5. N=1200;
  6. t=(1:N)/fs;
  7. f1=40; f2=100; %czestotliwosci sinusoid
  8. A1=1; A2=1; %amplitudy sinusoid
  9. s=A1*sin(2*pi*f1*t)+A2*sin(2*pi*f2*t)+randn(1,N); %sygnal testowy
  10. [b,a]=butter(rzad_filtru,2*f_gr/fs) %wspolczynnik b i a ]
  11. %
  12. [H,wf]=freqz(b,a,N) %transmitancja filtru
  13. s_filtr=filter(b,a,s); %sygnal po filtracji
  14.  
  15. %wykkresy----------------------------------
  16. subplot(2,1,1)
  17. fn=(wf/(pi))*fs; % czestotliwosc unormowana (0-1)
  18. plot(fn/2, abs(H), 'r') ; grid on
  19. xlabel('Czestotliwosc[Hz');
  20. ylabel('char.ampl.filtru|H(f)|');
  21. HM=abs(H); %modul funkcji transmitancji (char.amplitudowa)
  22. Hmax=max(HM); %wartosc max modulu funkcji transmitancji
  23. subplot(2,1,2)
  24. plot(fn/2,20*log10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement