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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>kaiserord</title>
<style type="text/css" media="all">
@import url("scilab_code.css");
@import url("xml_code.css");
@import url("c_code.css");
@import url("style.css");
</style>
</head>
<body>
<div class="manualnavbar">
<table width="100%"><tr>
<td width="30%">
<span class="previous"><a href="kaiser.html"><< kaiser</a></span>
</td>
<td width="40%" class="center">
<span class="top"><a href="section_cc2bc01c47967d47fcf3507a91d572ba.html">FOSSEE Signal Processing Toolbox</a></span>
</td>
<td width="30%" class="next">
<span class="next"><a href="lar2rc.html">lar2rc >></a></span>
</td>
</tr></table>
<hr />
</div>
<span class="path"><a href="index.html">FOSSEE Signal Processing Toolbox</a> >> <a href="section_cc2bc01c47967d47fcf3507a91d572ba.html">FOSSEE Signal Processing Toolbox</a> > kaiserord</span>
<br /><br />
<div class="refnamediv"><h1 class="refname">kaiserord</h1>
<p class="refpurpose">Return the parameters needed to produce a filter of the desired specification from a Kaiser window.</p></div>
<div class="refsynopsisdiv"><h3 class="title">Calling Sequence</h3>
<div class="synopsis"><pre><span class="default">[</span><span class="default">n</span><span class="default">, </span><span class="default">Wn</span><span class="default">, </span><span class="default">beta</span><span class="default">, </span><span class="default">ftype</span><span class="default">] = </span><span class="functionid">kaiserord</span><span class="default"> (</span><span class="default">f</span><span class="default">, </span><span class="default">m</span><span class="default">, </span><span class="default">dev</span><span class="default">, </span><span class="default">fs</span><span class="default">)</span>
<span class="default">[…] = </span><span class="functionid">kaiserord</span><span class="default"> (</span><span class="default">f</span><span class="default">, </span><span class="default">m</span><span class="default">, </span><span class="default">dev</span><span class="default">, </span><span class="default">fs</span><span class="default">)</span>
<span class="default">[…] = </span><span class="functionid">kaiserord</span><span class="default"> (</span><span class="default">f</span><span class="default">, </span><span class="default">m</span><span class="default">, </span><span class="default">dev</span><span class="default">)</span></pre></div></div>
<div class="refsection"><h3 class="title">Parameters</h3>
<dl><dt><span class="term">f:</span>
<dd><p class="para">Pairs of frequency band edges.</p></dd></dt>
<dt><span class="term">m:</span>
<dd><p class="para">Magnitude response for each band.</p></dd></dt>
<dt><span class="term">dev:</span>
<dd><p class="para">Deviation of the filter.</p></dd></dt>
<dt><span class="term">fs:</span>
<dd><p class="para">Sampling rate.</p></dd></dt></dl></div>
<div class="refsection"><h3 class="title">Description</h3>
<p class="para">This is an Octave function.
The vector f contains pairs of frequency band edges in the range [0,1]. The vector m specifies the magnitude response for each band. The values of m must be zero for all stop bands and must have the
same magnitude for all pass bands. The deviation of the filter dev can be specified as a scalar or a vector of the same length as m. The optional sampling rate fs can be used to indicate that f is in
Hz in the range [0,fs/2].</p>
<p class="para">The returned value n is the required order of the filter (the length of the filter minus 1). The vector Wn contains the band edges of the filter suitable for passing to fir1. The value beta is the
parameter of the Kaiser window of length n+1 to shape the filter. The string ftype contains the type of filter to specify to fir1.</p>
<p class="para">The Kaiser window parameters n and beta are computed from the relation between ripple (A=-20*log10(dev)) and transition width (dw in radians) discovered empirically by Kaiser:</p>
<p class="para"></p>
<p class="para">/ 0.1102(A-8.7) A > 50
beta = | 0.5842(A-21)^0.4 + 0.07886(A-21) 21 <= A <= 50
\ 0.0 A < 21</p>
<p class="para">n = (A-8)/(2.285 dw)</p></div>
<div class="refsection"><h3 class="title">Examples</h3>
<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabopenclose">[</span><span class="scilabid">n</span><span class="scilabdefault">,</span> <span class="scilabid">w</span><span class="scilabdefault">,</span> <a class="scilabcommand" href="scilab://beta">beta</a><span class="scilabdefault">,</span> <span class="scilabid">ftype</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">kaiserord</span> <span class="scilabopenclose">(</span><span class="scilabopenclose">[</span><span class="scilabnumber">1000</span><span class="scilabdefault">,</span> <span class="scilabnumber">1200</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span> <span class="scilabnumber">0</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabopenclose">[</span><span class="scilabnumber">0.05</span><span class="scilabdefault">,</span> <span class="scilabnumber">0.05</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabnumber">11025</span><span class="scilabopenclose">)</span>
<span class="scilabid">n</span> <span class="scilaboperator">=</span> <span class="scilabnumber">1</span>
<span class="scilabid">w</span> <span class="scilaboperator">=</span> <span class="scilabnumber">1100</span>
<a class="scilabcommand" href="scilab://beta">beta</a> <span class="scilabstring">=</span> <span class="scilabstring">1.5099</span>
<span class="scilabid">ftype</span> <span class="scilaboperator">=</span> <span class="scilabid">low</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div>
<br />
<div class="manualnavbar">
<table width="100%">
<tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr>
<tr>
<td width="30%">
<span class="previous"><a href="kaiser.html"><< kaiser</a></span>
</td>
<td width="40%" class="center">
<span class="top"><a href="section_cc2bc01c47967d47fcf3507a91d572ba.html">FOSSEE Signal Processing Toolbox</a></span>
</td>
<td width="30%" class="next">
<span class="next"><a href="lar2rc.html">lar2rc >></a></span>
</td>
</tr></table>
<hr />
</div>
</body>
</html>
|