ECE 301 -- 3-31 Project

ECE 301 -- 3-31 Project - clear Delta_t = 2e-5; num_pts =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
clear df = 0.01; f_final = 30; fHz = 0:df:f_final; s = j*2*pi*fHz; num = s.*s + 8.72*s + 2500; den = s.*s + 13.68*s + 400; Hf = 2*(num./den); magHf = abs(Hf); subplot(311) plot(fHz,magHf) grid xlabel( 'f in Hz' ) ylabel( '|H(f)|' ) title( 'frequency response plot' ) axis([0 30 0 20]) subplot(312) semilogy(fHz,magHf) grid xlabel( 'f in Hz' ) ylabel( '|H(f)|' ) title( 'semilogy frequency response plot' ) axis([0 30 0.1 30]) subplot(313) loglog(fHz,magHf) grid xlabel( 'f in Hz' ) ylabel( '|H(f)|' ) title( 'loglog frequency response plot' ) axis([1 100 0.1 100]) HdB = 20*log10(magHf); plot(fHz,HdB), grid xlabel( 'f in Hz' ),ylabel( '|H(f)| in dB' ), title( 'dB frequency response plot' ) axis([ 0 30 -10 30])
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: clear Delta_t = 2e-5; num_pts = 51; mvalues = 0:1:(num_pts-1); t_secs = mvalues*Delta_t; t_final = (num_pts-1)*Delta_t; x = ones(1,num_pts); R = 1000; C = 159.16e-9; b = 1/(R*C); bdel = b*Delta_t; K1 = 1/(1+bdel); K2 = bdel/(1+bdel); xcoeffs = [ K2 ]; ycoeffs = [ 1 , -K1]; y = filter( xcoeffs, ycoeffs, x ); subplot(211), plot(t_secs,x, '*' ),grid xlabel( 't, sec.' ),ylabel( 'input, x(t)' ) axis([-0.00005 t_final 0 1.2 ]); title( 'Input' ) subplot(212),plot(t_secs ,y, '*' ),grid xlabel( 't, sec.' ),ylabel( 'output, y(t)' ) axis([-0.00005 t_final 0 1.2 ]); title( 'Simulation Output' )...
View Full Document

This note was uploaded on 01/28/2012 for the course ECE 301 taught by Professor Hoozturk during the Fall '08 term at N.C. State.

Page1 / 2

ECE 301 -- 3-31 Project - clear Delta_t = 2e-5; num_pts =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online