You are on page 1of 2

MATLAB CODING :-ATTENUATOR

r0=input ('Enter the resistance :');


D=input ('Enter the attenuation :');
N=power (10, (D/20))
ra=r0*(N-1)
rb=r0/(N-1)
n= (ra/r0) +1
at=20*log10(n);
at=linspace(at,at,100);
f=linspace(0,1000,100);
plot (f,at);
xlabel('frequency ');
ylabel('neper');

OUTPUT:
Enter the resistance :600

Enter the attenuation :10

N = 3.1623

ra = 1.2974e+03

rb = 277.4852

n = 3.1623
ATTENUATOR:

11

10.8

10.6

10.4

10.2
neper

10

9.8

9.6

9.4

9.2

9
0 100 200 300 400 500 600 700 800 900 1000
frequency

You might also like