File: iirfilt.dem.sce

package info (click to toggle)
scilab 6.0.1-10%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 365,292 kB
  • sloc: xml: 827,376; cpp: 273,125; ansic: 216,672; java: 190,706; fortran: 90,783; ml: 24,107; tcl: 16,853; sh: 13,608; makefile: 9,556; lex: 1,615; perl: 1,566; yacc: 1,263; php: 690; cs: 614
file content (38 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download | duplicates (5)
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
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA
// Copyright (C) 2010 - DIGITEO - Allan CORNET
//
// This file is released under the 3-clause BSD license. See COPYING-BSD.

function demo_irrfilter()

    ////////////////////////
    //DISCRETE IIR FILTERS//
    ////////////////////////

    //Low pass filter (length 5, type cheb1, cut-off .2)
    hz = iir(5, "lp", "cheb1", [.2 0], [.05 .05]);
    [hzm,fr] = frmag(hz,256);

    my_handle = scf(100001);
    if is_handle_valid(my_handle) then
        clf(my_handle, "reset");
        plot2d(fr', hzm');
        xtitle(_("Discrete IIR filter: low pass  fr < 0.2"), " ", " ");
        halt(_("Press Return to continue ... \n"));
    end

    //Band pass filter (length 3, type ellip, cut-offs .15 and .25)
    hz = iir(3, "bp", "ellip", [.15 .25], [.08 .03]);
    [hzm,fr] = frmag(hz,256);
    if is_handle_valid(my_handle) then
        clf(my_handle, "reset");
        demo_viewCode("iirfilt.dem.sce");
        plot2d(fr',hzm');
        xtitle(_("Discrete IIR filter: band pass 0.15 < fr < 0.25"), " ", " ");
    end

endfunction

demo_irrfilter();
clear demo_irrfilter;