Advertisement
poujouly

Untitled

May 28th, 2019
3,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.58 KB | None | 0 0
  1. // Premier Script NAVTEX
  2. clear;clf;
  3.  
  4. function [num,den]=Pbande2ordNum(Q,Fo,Fe)
  5.     a=1/tan(%pi*Fo/Fe);
  6.     num=[a/Q 0 -a/Q];
  7.     den=[1+a/Q+a^2 2-2*a^2 1-a/Q+a^2];
  8. endfunction
  9.  
  10. // Définition des variables
  11. Fe=44100;Res=1;
  12. Npt=round(Fe/(2*Res));
  13. F1=1615;F2=1785;Q=10;
  14. [num1,den1]=Pbande2ordNum(Q,F1,Fe);
  15. [num2,den2]=Pbande2ordNum(Q,F2,Fe);
  16.  
  17. Fstart=1500;Fstop=1900;
  18. Nstart=round(Fstart/Res);Nstop=round(Fstop/Res);
  19. [H1,fr]=frmag(num1,den1,Npt);
  20. plot(fr(Nstart:Nstop)*Fe,H1(Nstart:Nstop),'r');
  21. [H2,fr]=frmag(num2,den2,Npt);
  22. plot(fr(Nstart:Nstop)*Fe,H2(Nstart:Nstop),'g');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement