blob: 18dc7fcb95a78e112863eda8c7a5e1922653829d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Exa 7.3
clc;
clear;
// Given data
Attn=40; // Attenuation in dB
x=2; // x= ratio of W to Wh
// Solution
printf(' Using equation 7.26,\n');
// 20*log(H(jw)/A0)=-40; // -ve since it is attenuation
// gives
// H(jw)/A0 = 10^-2 = 0.01
// so
// (0.01)^2 = 1/(1+2^(2*n));
// or 2^2n = 10^4 - 1;
// solving for n, we get
n=log(10^(4) -1)/(2*log(2));
printf(' The calculated value of n = %.2f. \n',n);
printf(' Since order of filter must be an integer so, n = %d. \n',round(n));
|