whats wrong with my code

Thread Starter

Psf1575

Joined Mar 2, 2018
16
p.

>> omega_c = 2*pi*2000;

>> C = 1e-6;

>> R = 1/sqrt (C^2*omega_c^2)





f = linspace ( 0, 20000, 200);

>> B = 1; A = [R*C 1]; Hmag_RC = abs([H] (B, A, f*2*pi));




>> plot(f, abs(f*2*pi) <=omega_c, 'k-', f, Hmag_RC, 'k--');




>> xlabel ('f [Hz]'); ylabel ('|H_{RC} (j2\pi f)|');

>> axis ([0 20000 -0.05 1.05]); legend('Ideal' , 'First-Order RC');

why wont my code work to get the magnitude response of this filter. I even tried calling the function on the separate file. function [H] = MS4P1 (A, B, omega);

thanks!
 

WBahn

Joined Mar 31, 2012
30,045
It might help if you gave some kind of a clue as to what platform you are using?

It might also help if you described what you are getting that is not correct and what steps you have taken to walk through and verify what is and is not working and at what point things go off the rails.
 
Top