Advertisement
deemde

SuS 13 Checker

Jan 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.72 KB | None | 0 0
  1. % The numerator and denominator of the filter      
  2. filter1.gain = 1;
  3. filter1.numerator   = [2.8, -5.1, -3.9, 6.2] * filter1.gain;
  4. filter1.denominator = [1, -6.9, 4.1, +4.5];
  5.  
  6. % Calculate the impulse response      
  7. filter1.impulse = filter( filter1.numerator, filter1.denominator, [1, zeros(1,5)] );
  8.  
  9. % Calculate the step response      
  10. filter1.step = filter( filter1.numerator, filter1.denominator, ones(1,6) );
  11.      
  12. % impulse response vs time graph
  13. subplot( 2,1,1 );
  14. stem( filter1.impulse );
  15. title( 'Impulse Response' );
  16. xlabel('Time (Samples)');
  17. ylabel('Impulse Response');
  18.      
  19. subplot(2,1,2 );
  20. stem( filter1.step );    
  21. title( 'Step Response' );
  22. xlabel('Time (Samples)');
  23. ylabel('Step Response');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement