image thumbnail

Low pass filter channel

by

 

All communication work as Low pass filter even optical fiber work as LPF for broading of pulses.

LPF_channel.m
clc;
close all;
clear all;
format long
rp= input('Enter the pass band ripple');
rs=input('Enter the stop band ripple');
wp=input('Enter the pass band frequency');
ws=input('Enter the stop band frequency');
fs=input('Enter the sampling frequency');
w1= 2*wp/fs;
w2= 2*ws/fs;
bitx=input('Enter the transmitted bits');
x=rectpulse(bitx,10);
[n,wn]= buttord(w1,w2,rp,rs,'s');
[z,p,k]=butter(n,wn);
[b,a]=zp2tf(z,p,k);
z=filter(b,a,x);
figure
subplot(211)
plot(x)
axis([0 100 -.5 1.5])
subplot(212)
plot(z)
axis([0 100 -.5 1.5])
w= 0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure
subplot(211)
plot(om/pi,m);
ylabel('Gain in db-------->')
xlabel('(a) Normalized frequency');
subplot(212)
plot(om/pi,an);
xlabel('(b) Normalized frequency');
ylabel('phase in radian-------->')

Contact us