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

« back to all changes in this revision

Viewing changes to demos/signal/winfilt.dem

  • 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
////////////////////////
 
2
//WINDOWED FIR FILTERS//
 
3
////////////////////////
 
4
// Copyright INRIA
 
5
 
 
6
//Low pass filter (length 33, Kaiser window, cut-off .2)
 
7
   [wft,wfm,fr]=wfir('lp',33,[.2 0],'kr',[5.6 0]);
 
8
   plot2d(fr',log(wfm)')
 
9
   xtitle(' ','frequency','magnitude');
 
10
   xtitle(['Windowed FIR Low pass Filter';...
 
11
          'Kaiser window,cut-off:0.2';...
 
12
          'length 33'])
 
13
   halt();
 
14
         xbasc(); 
 
15
 
 
16
//Stop band filter (length 127, Hamming window, cut-offs .2 and .3)
 
17
   [wft,wfm,fr]=wfir('sb',127,[.2 .3],'hm',[0 0]);
 
18
   plot2d(fr',log(wfm)')
 
19
   xtitle(' ','frequency','magnitude')
 
20
   xtitle(['Windowed FIR Low pass Filter';...
 
21
          'Hamming window,cut-off:0.2,0.3';...
 
22
          'length 127'])
 
23
         xbasc(); 
 
24
 
 
25
//Band pass filter (length 55, Chebyshev window, cut-offs .15 and .35)
 
26
   [wft,wfm,fr]=wfir('bp',55,[.15 .35],'ch',[.001 -1]);
 
27
   plot2d(fr',log(wfm)')
 
28
   xtitle(' ','frequency','magnitude')
 
29
   xtitle(['Windowed FIR Band pass Filter';...
 
30
          'Chebyshev window,cut-off:0.15,0.35';...
 
31
          'length 55'])
 
32
         xbasc();