Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % The numerator and denominator of the filter
- filter1.gain = 1;
- filter1.numerator = [2.8, -5.1, -3.9, 6.2] * filter1.gain;
- filter1.denominator = [1, -6.9, 4.1, +4.5];
- % Calculate the impulse response
- filter1.impulse = filter( filter1.numerator, filter1.denominator, [1, zeros(1,5)] );
- % Calculate the step response
- filter1.step = filter( filter1.numerator, filter1.denominator, ones(1,6) );
- % impulse response vs time graph
- subplot( 2,1,1 );
- stem( filter1.impulse );
- title( 'Impulse Response' );
- xlabel('Time (Samples)');
- ylabel('Impulse Response');
- subplot(2,1,2 );
- stem( filter1.step );
- title( 'Step Response' );
- xlabel('Time (Samples)');
- ylabel('Step Response');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement