Mercurial > hg > ltpda
comparison testing/utp_1.1/utp_fcns/get_test_objects_mfir.m @ 44:409a22968d5e default
Add unit tests
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 18:42:11 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
43:bc767aaa99a8 | 44:409a22968d5e |
---|---|
1 % GET_TEST_OBJECTS_MFIR returns a set of MFIR objects suitable for many of the UTPs | |
2 % | |
3 % CALL: [firhp,firlp,firbp,firbr,firpzm,firao,firv,firm] = get_test_objects_mfir | |
4 % [fir1,fir2,fir3,fir4,fir5,fir6,firv,firm] = get_test_objects_mfir | |
5 % | |
6 % OUTPUTS: | |
7 % firhp - FIR highpass filter | |
8 % firlp - FIR lowpass filter | |
9 % firbp - FIR bandpass filter | |
10 % firbr - FIR bandreject filter | |
11 % firpzm - FIR object created from a pole/zero model | |
12 % firao - FIR object created from an analysis object | |
13 % firv - [firhp firlp firbr firao]; | |
14 % firm - [firhp firpzm firbp; firlp firbr firao]; | |
15 % | |
16 % | |
17 % M Hewitson 06-08-08 | |
18 % | |
19 % $Id: get_test_objects_mfir.m,v 1.5 2009/01/27 16:29:14 ingo Exp $ | |
20 % | |
21 function [firhp,firlp,firbp,firbr,firpzm,firao,firv,firm] = get_test_objects_mfir | |
22 | |
23 | |
24 %% FIR highpass filter | |
25 firhp = mfir(plist('type', 'highpass')); | |
26 firhp.setName(); | |
27 | |
28 %% FIR lowpass filter | |
29 firlp = mfir(plist('type', 'lowpass')); | |
30 firlp.setName(); | |
31 | |
32 %% FIR bandpass filter | |
33 firbp = mfir(plist('type', 'bandpass', 'fc', [0.01 0.1])); | |
34 firbp.setName(); | |
35 | |
36 %% FIR bandreject filter | |
37 firbr = mfir(plist('type', 'bandreject', 'fc', [0.01 0.1])); | |
38 firbr.setName(); | |
39 | |
40 %% FIR created from pole/zero model | |
41 pzm = pzmodel(1, [pz(1) pz(200)], pz(50)); | |
42 pl = plist('pzmodel', pzm, 'fs', 1000); | |
43 firpzm = mfir(pl); | |
44 firpzm.setName(); | |
45 | |
46 %% FIR created from AO | |
47 a1 = ao(plist('fsfcn', '1./(50+f)', 'f', linspace(0, 500, 1000))); | |
48 a1.setFs(1000); | |
49 pl = plist('ao', a1); | |
50 firao = mfir(pl); | |
51 firao.setName(); | |
52 | |
53 %% FIR vector | |
54 firv = [firhp firlp firbr firao]; | |
55 | |
56 %% FIR matrix | |
57 firm = [firhp firpzm firbp; firlp firbr firao]; | |
58 | |
59 end |