From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 40/CH10/EX10.4a/Exa_10_4.sce | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 40/CH10/EX10.4a/Exa_10_4.sce (limited to '40/CH10/EX10.4a/Exa_10_4.sce') diff --git a/40/CH10/EX10.4a/Exa_10_4.sce b/40/CH10/EX10.4a/Exa_10_4.sce new file mode 100755 index 000000000..7880882ab --- /dev/null +++ b/40/CH10/EX10.4a/Exa_10_4.sce @@ -0,0 +1,29 @@ +//Half band FIR Filter Design +//(a)lowpass Half band Filter +s=%s;z=%z; +fp=8;fs=16;Ap=1;As=50; +S=2*(fs+fp); +Fp=fp/S;Fs=fs/S;Fc=0.25; +delp=(10^(Ap/20)-1)/(10^(Ap/20)+1); +dels=10^(-As/20); +del=min(delp,dels); +As0=-20*log10(del) +N1=(As0-7.95)/(14.36*(Fs-Fp))+1; +N1=int(N1)+1; +B=0.0351*(As0-8.7) +[hn1]=eqfir(19,[0 1/6;1/3 0.5],[1 0],[1 1]); +[HLPF1,fr1]=frmag(hn1,512); +HLPf1=20*log10(HLPF1); +a=gca(); +plot2d(fr1,HLPf1); +xlabel('Digital Frequency'); +ylabel('Magnitude in dB'); +xtitle('Kaiser half band LPF:B=1.44;Fc=0.25'); +[hn2]=eqfir(21,[0 1/6;1/3 0.5],[1 0],[1 1]); +[HLPF2,fr2]=frmag(hn2,512); +HLPf2=20*log10(HLPF2); +xset('window',1); +plot2d(fr2,HLPf2); +xlabel('Digital Frequency'); +ylabel('Magnitude in dB'); +xtitle('Hamming half-band LPF:N=21;Fc=0.25'); -- cgit