~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/signal/yulewalk.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
yulewalk          Scilab Group          Scilab Function            yulewalk
 
2
NAME
 
3
   yulewalk -  least-square filter design
 
4
  
 
5
CALLING SEQUENCE
 
6
 Hz = yulewalk(N,frq,mag) 
 
7
PARAMETERS
 
8
 N          : integer (order of desired filter)
 
9
            
 
10
 frq        : real row vector (non-decreasing order), frequencies.
 
11
            
 
12
 mag        : non negative real row vector (same size as frq), desired
 
13
            magnitudes.
 
14
            
 
15
 Hz         : filter B(z)/A(z)
 
16
            
 
17
DESCRIPTION
 
18
   Hz = yulewalk(N,frq,mag) finds the N-th order iir filter
 
19
  
 
20
                   n-1         n-2            
 
21
       B(z)   b(1)z     + b(2)z    + .... + b(n)
 
22
 H(z)= ---- = ---------------------------------
 
23
                 n-1       n-2
 
24
       A(z)    z   + a(2)z    + .... + a(n)
 
25
   which matches the magnitude frequency response given by vectors frq and
 
26
  mag. Vectors frq and mag specify the frequency and magnitude of the
 
27
  desired frequency response. The frequencies in frq must be between 0.0
 
28
  and 1.0, with 1.0 corresponding to half the sample rate. They must be in
 
29
  increasing order and start with 0.0 and end with 1.0. 
 
30
  
 
31
EXAMPLE
 
32
 f=[0,0.4,0.4,0.6,0.6,1];H=[0,0,1,1,0,0];Hz=yulewalk(8,f,H);
 
33
 fs=1000;fhz = f*fs/2;  
 
34
 xbasc(0);xset('window',0);plot2d(fhz',H');
 
35
 xtitle('Desired Frequency Response (Magnitude)')
 
36
 [frq,repf]=repfreq(Hz,0:0.001:0.5);
 
37
 xbasc(1);xset('window',1);plot2d(fs*frq',abs(repf'));
 
38
 xtitle('Obtained Frequency Response (Magnitude)')
 
39
   
 
40