File: remezb.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (78 lines) | stat: -rw-r--r-- 2,002 bytes parent folder | download | duplicates (2)
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
.TH remezb 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
remezb - Minimax approximation of magnitude response
.SH CALLING SEQUENCE
.nf
[an]=remezb(nc,fg,ds,wt)
.fi
.SH PARAMETERS
.TP
nc
: Number of cosine functions
.TP
fg
: Grid of frequency points in [0,.5)
.TP
ds
: Desired magnitude on grid \fVfg\fR
.TP
wt
: Weighting function on error on grid \fVfg\fR
.TP
an
: Cosine filter coefficients
.SH DESCRIPTION
Minimax approximation of a frequency domain
magnitude response. The approximation takes
the form \fVh = sum[a(n)*cos(wn)]\fR
for n=0,1,...,nc. An FIR, linear-phase filter
can be obtained from the the output of the function
by using the following commands
.nf
         hn(1:nc-1)=an(nc:-1:2)/2;
         hn(nc)=an(1);
         hn(nc+1:2*nc-1)=an(2:nc)/2;
.fi
.SH EXAMPLE
.nf
// Choose the number of cosine functions and create a dense grid 
// in [0,.24) and [.26,.5)
nc=21;ngrid=nc*16;
fg=.24*(0:ngrid/2-1)/(ngrid/2-1);
fg(ngrid/2+1:ngrid)=fg(1:ngrid/2)+.26*ones(1:ngrid/2);
// Specify a low pass filter magnitude for the desired response
ds(1:ngrid/2)=ones(1:ngrid/2);
ds(ngrid/2+1:ngrid)=zeros(1:ngrid/2);
// Specify a uniform weighting function
wt=ones(fg);
// Run remezb
an=remezb(nc,fg,ds,wt)
// Make a linear phase FIR filter 
hn(1:nc-1)=an(nc:-1:2)/2;
hn(nc)=an(1);
hn(nc+1:2*nc-1)=an(2:nc)/2;
// Plot the filter's magnitude response
plot(.5*(0:255)/256,frmag(hn,256));
//////////////
// Choose the number of cosine functions and create a dense grid in [0,.5)
nc=21; ngrid=nc*16;
fg=.5*(0:(ngrid-1))/ngrid;
// Specify a triangular shaped magnitude for the desired response
ds(1:ngrid/2)=(0:ngrid/2-1)/(ngrid/2-1);
ds(ngrid/2+1:ngrid)=ds(ngrid/2:-1:1);
// Specify a uniform weighting function
wt=ones(fg);
// Run remezb
an=remezb(nc,fg,ds,wt)
// Make a linear phase FIR filter 
hn(1:nc-1)=an(nc:-1:2)/2;
hn(nc)=an(1);
hn(nc+1:2*nc-1)=an(2:nc)/2;
// Plot the filter's magnitude response
plot(.5*(0:255)/256,frmag(hn,256));
.fi
.SH AUTHOR
C. B.
.SH SEE ALSO
eqfir