Mercurial > hg > ltpda
comparison m-toolbox/test/pipelines/test_ao_fft.lwb @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <LTPDAworkbench filepath="test_ao_fft.lwb" name="test_ao_fft.lwb" version="0.4"> | |
3 <document UUID="4aa71a1c-e0fd-46e4-8361-4d39a6f19e48" title="Test AO fft" visible="true" windowHeight="1045" windowState="maximized" windowWidth="1429" windowX="0" windowY="0"> | |
4 <canvas name="Test AO fft" zoomFactor="1.0"> | |
5 <CanvasInfo author="hewitson" created="2009-01-31 13:12:33" description="Test the fft method of the AO class." lastModified="2011-04-27 09:04:53"/> | |
6 <block UUID="0d37a0dd-fa0c-44d5-994f-3fb10ee05532" attachWorkbench="false" bounds="0 134 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="a1"> | |
7 <port UUID="eab2927b-1af7-4776-a150-958bbd62fcfc" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
8 <node UUID="5fc64c5a-6d6a-4103-a8d3-13e1303a96f3" bounds="48 161 27 143" name=""> | |
9 <pipe bezier="false" color="-3657166" dstPortUUID="1fac2922-a3e1-4947-adad-d7bed7232dee" dstblock="New Block_3" dstport="0" srcPortUUID="eab2927b-1af7-4776-a150-958bbd62fcfc" srcblock="a1" thickness="2.0"/> | |
10 <pipe bezier="false" color="-3657166" dstPortUUID="7b4ce913-f411-441f-8a51-59a073326e22" dstblock="a3" dstport="0" srcPortUUID="eab2927b-1af7-4776-a150-958bbd62fcfc" srcblock="a1" thickness="2.0"/> | |
11 </node> | |
12 </port> | |
13 <LTPDAalgorithm mcategory="Constructor" mclass="ao" mname="ao" mpackage="" mversion="" portdims="0 -1 1 1"/> | |
14 <plist UUID="9e48103c-ea96-490e-b894-b6ab9506c095" created="-1" description="" name="none"> | |
15 <param active="true" desc="" key="TSFCN"> | |
16 <ParamValue index="0" selection="0"> | |
17 <Option javaType="java.lang.String" matlabType="char" value="sin(2*pi*7.433*t) + randn(size(t))"/> | |
18 </ParamValue> | |
19 </param> | |
20 <param active="true" desc="" key="FS"> | |
21 <ParamValue index="0" selection="0"> | |
22 <Option javaType="java.lang.String" matlabType="char" value="1000"/> | |
23 </ParamValue> | |
24 </param> | |
25 <param active="true" desc="" key="NSECS"> | |
26 <ParamValue index="0" selection="0"> | |
27 <Option javaType="java.lang.String" matlabType="char" value="10"/> | |
28 </ParamValue> | |
29 </param> | |
30 <param active="true" desc="" key="T0"> | |
31 <ParamValue index="0" selection="0"> | |
32 <Option javaType="java.lang.String" matlabType="char" value="1970-01-01 00:00:00.000"/> | |
33 </ParamValue> | |
34 </param> | |
35 <param active="true" desc="" key="XUNITS"> | |
36 <ParamValue index="0" selection="0"> | |
37 <Option javaType="java.lang.String" matlabType="char" value="s"/> | |
38 </ParamValue> | |
39 </param> | |
40 <param active="true" desc="" key="YUNITS"> | |
41 <ParamValue index="0" selection="0"> | |
42 <Option javaType="java.lang.String" matlabType="char" value=""/> | |
43 </ParamValue> | |
44 </param> | |
45 </plist> | |
46 </block> | |
47 <block UUID="e21edc20-467a-48cd-860f-d60d84bfdd27" attachWorkbench="false" bounds="70 147 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="New Block_3"> | |
48 <port UUID="1fac2922-a3e1-4947-adad-d7bed7232dee" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
49 <node UUID="2a1e6eec-a330-4e8e-914b-3d5dc76a7bb7" bounds="48 161 33 19" name=""> | |
50 <pipe bezier="false" color="-3657166" dstPortUUID="1fac2922-a3e1-4947-adad-d7bed7232dee" dstblock="New Block_3" dstport="0" srcPortUUID="eab2927b-1af7-4776-a150-958bbd62fcfc" srcblock="a1" thickness="2.0"/> | |
51 </node> | |
52 </port> | |
53 <port UUID="6463a9e9-c594-484d-9a28-1e7762b00170" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
54 <node UUID="7729540a-efa6-4667-90b5-b31297d81815" bounds="118 174 32 11" name=""> | |
55 <pipe bezier="false" color="-3657166" dstPortUUID="01e82e24-2610-4537-8ac7-d6eb8541f88b" dstblock="New Block" dstport="0" srcPortUUID="6463a9e9-c594-484d-9a28-1e7762b00170" srcblock="New Block_3" thickness="2.0"/> | |
56 </node> | |
57 </port> | |
58 <LTPDAalgorithm mcategory="Signal Processing" mclass="ao" mname="fft" mpackage="" mversion="" portdims="1 -1 1 -1"/> | |
59 <plist UUID="b9aca370-36c8-456f-abc5-fada05ec60da" created="0" description="" name="none"> | |
60 <param active="true" desc="The fft type. Plain (complete non-symmetric), One-sided (from zero to Nyquist) or two-sided (complete symmetric)." key="TYPE"> | |
61 <ParamValue index="1" selection="1"> | |
62 <Option javaType="java.lang.String" matlabType="char" value="plain"/> | |
63 <Option javaType="java.lang.String" matlabType="char" value="one"/> | |
64 <Option javaType="java.lang.String" matlabType="char" value="two"/> | |
65 </ParamValue> | |
66 </param> | |
67 </plist> | |
68 </block> | |
69 <block UUID="ea720ba6-891a-4953-a234-ba6f85d49c9b" attachWorkbench="false" bounds="139 152 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="New Block"> | |
70 <port UUID="01e82e24-2610-4537-8ac7-d6eb8541f88b" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
71 <node UUID="7729540a-efa6-4667-90b5-b31297d81815" bounds="118 174 32 11" name=""> | |
72 <pipe bezier="false" color="-3657166" dstPortUUID="01e82e24-2610-4537-8ac7-d6eb8541f88b" dstblock="New Block" dstport="0" srcPortUUID="6463a9e9-c594-484d-9a28-1e7762b00170" srcblock="New Block_3" thickness="2.0"/> | |
73 </node> | |
74 </port> | |
75 <port UUID="eff9c9d5-e545-4e8c-857f-1132c9a3f3a2" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
76 <node UUID="d854197f-435c-442a-ae18-53a06313c512" bounds="187 179 31 21" name=""> | |
77 <pipe bezier="false" color="-3657166" dstPortUUID="845b87ae-8d73-4b59-8603-eda12dc4d2ff" dstblock="a2" dstport="0" srcPortUUID="eff9c9d5-e545-4e8c-857f-1132c9a3f3a2" srcblock="New Block" thickness="2.0"/> | |
78 </node> | |
79 </port> | |
80 <LTPDAalgorithm mcategory="Operator" mclass="ao" mname="abs" mpackage="" mversion="" portdims="1 -1 1 -1"/> | |
81 <plist UUID="97c5ddfe-a582-4e02-b452-e27c8c912191" created="-1" description="" name="none"/> | |
82 </block> | |
83 <block UUID="375018c5-6ee5-444d-a068-bab5091a35f1" attachWorkbench="false" bounds="207 175 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="a2"> | |
84 <port UUID="845b87ae-8d73-4b59-8603-eda12dc4d2ff" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
85 <node UUID="d854197f-435c-442a-ae18-53a06313c512" bounds="187 179 31 21" name=""> | |
86 <pipe bezier="false" color="-3657166" dstPortUUID="845b87ae-8d73-4b59-8603-eda12dc4d2ff" dstblock="a2" dstport="0" srcPortUUID="eff9c9d5-e545-4e8c-857f-1132c9a3f3a2" srcblock="New Block" thickness="2.0"/> | |
87 </node> | |
88 </port> | |
89 <port UUID="ab07fec4-b49a-4a98-8dc2-c920a6c6b994" bounds="0 0 10 10" name="" number="1" terminal="" type="input"> | |
90 <node UUID="fed5365d-7357-4318-b8df-542f91678649" bounds="188 210 30 40" name=""> | |
91 <pipe bezier="false" color="-3657166" dstPortUUID="ab07fec4-b49a-4a98-8dc2-c920a6c6b994" dstblock="a2" dstport="1" srcPortUUID="74188127-e5c7-403c-ad41-4fbf11d9fa26" srcblock="two" thickness="2.0"/> | |
92 </node> | |
93 </port> | |
94 <port UUID="f8d1333b-4fec-46aa-97c2-5e971a5266aa" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
95 <node UUID="ea4c5733-08c6-4343-be9d-68f7b7bf8858" bounds="255 202 29 43" name=""> | |
96 <pipe bezier="false" color="-3657166" dstPortUUID="b1372b68-16eb-4f00-9de5-90863543ca4a" dstblock="rat" dstport="0" srcPortUUID="f8d1333b-4fec-46aa-97c2-5e971a5266aa" srcblock="a2" thickness="2.0"/> | |
97 </node> | |
98 </port> | |
99 <LTPDAalgorithm mcategory="Arithmetic Operator" mclass="ao" mname="power" mpackage="" mversion="" portdims="1 -1 1 -1"/> | |
100 <plist UUID="65664d19-f997-4d90-83c2-43f7547bcf5b" created="-1" description="" name="none"/> | |
101 </block> | |
102 <block UUID="2df9ef80-3715-4c67-b09d-f18bda4bdafe" attachWorkbench="false" bounds="64 271 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="a3"> | |
103 <port UUID="7b4ce913-f411-441f-8a51-59a073326e22" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
104 <node UUID="5fc64c5a-6d6a-4103-a8d3-13e1303a96f3" bounds="48 161 27 143" name=""> | |
105 <pipe bezier="false" color="-3657166" dstPortUUID="7b4ce913-f411-441f-8a51-59a073326e22" dstblock="a3" dstport="0" srcPortUUID="eab2927b-1af7-4776-a150-958bbd62fcfc" srcblock="a1" thickness="2.0"/> | |
106 </node> | |
107 </port> | |
108 <port UUID="758f6cd2-7a8b-4f61-ab69-aee627b29790" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
109 <node UUID="8802b216-330a-4e37-98f7-ae1c89b0c8c0" bounds="112 255 172 49" name=""> | |
110 <pipe bezier="false" color="-3657166" dstPortUUID="83419422-b98f-41b9-a1c7-8581be1842a0" dstblock="rat" dstport="1" srcPortUUID="758f6cd2-7a8b-4f61-ab69-aee627b29790" srcblock="a3" thickness="2.0"/> | |
111 </node> | |
112 </port> | |
113 <LTPDAalgorithm mcategory="Signal Processing" mclass="ao" mname="psd" mpackage="" mversion="" portdims="1 -1 1 -1"/> | |
114 <plist UUID="33edb029-64d2-4980-84cb-43ec6318262f" created="-1" description="" name="none"> | |
115 <param active="true" desc="" key="NFFT"> | |
116 <ParamValue index="0" selection="0"> | |
117 <Option javaType="java.lang.String" matlabType="char" value="10000"/> | |
118 </ParamValue> | |
119 </param> | |
120 <param active="true" desc="" key="WIN"> | |
121 <ParamValue index="0" selection="0"> | |
122 <Option javaType="java.lang.String" matlabType="char" value="specwin('Rectangular', -1)"/> | |
123 </ParamValue> | |
124 </param> | |
125 <param active="true" desc="" key="OLAP"> | |
126 <ParamValue index="0" selection="0"> | |
127 <Option javaType="java.lang.String" matlabType="char" value="-1"/> | |
128 </ParamValue> | |
129 </param> | |
130 <param active="true" desc="" key="SCALE"> | |
131 <ParamValue index="0" selection="0"> | |
132 <Option javaType="java.lang.String" matlabType="char" value="PSD"/> | |
133 </ParamValue> | |
134 </param> | |
135 <param active="true" desc="" key="ORDER"> | |
136 <ParamValue index="0" selection="0"> | |
137 <Option javaType="java.lang.String" matlabType="char" value="0"/> | |
138 </ParamValue> | |
139 </param> | |
140 </plist> | |
141 </block> | |
142 <block UUID="93f794ef-b65b-498a-9ed4-6eddd7e528f0" attachWorkbench="false" bounds="273 220 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="rat"> | |
143 <port UUID="b1372b68-16eb-4f00-9de5-90863543ca4a" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
144 <node UUID="ea4c5733-08c6-4343-be9d-68f7b7bf8858" bounds="255 202 29 43" name=""> | |
145 <pipe bezier="false" color="-3657166" dstPortUUID="b1372b68-16eb-4f00-9de5-90863543ca4a" dstblock="rat" dstport="0" srcPortUUID="f8d1333b-4fec-46aa-97c2-5e971a5266aa" srcblock="a2" thickness="2.0"/> | |
146 </node> | |
147 </port> | |
148 <port UUID="83419422-b98f-41b9-a1c7-8581be1842a0" bounds="0 0 10 10" name="" number="1" terminal="" type="input"> | |
149 <node UUID="8802b216-330a-4e37-98f7-ae1c89b0c8c0" bounds="112 255 172 49" name=""> | |
150 <pipe bezier="false" color="-3657166" dstPortUUID="83419422-b98f-41b9-a1c7-8581be1842a0" dstblock="rat" dstport="1" srcPortUUID="758f6cd2-7a8b-4f61-ab69-aee627b29790" srcblock="a3" thickness="2.0"/> | |
151 </node> | |
152 </port> | |
153 <port UUID="9d7a78c0-e32d-4118-a837-7cdb8e878b95" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
154 <node UUID="49f2e277-0413-4015-8829-c7b1daca68aa" bounds="241 247 136 106" name=""> | |
155 <pipe bezier="false" color="-3657166" dstPortUUID="17c1077b-643b-464c-90ae-e37eb1b14efe" dstblock="New Block_1" dstport="0" srcPortUUID="9d7a78c0-e32d-4118-a837-7cdb8e878b95" srcblock="rat" thickness="2.0"/> | |
156 </node> | |
157 </port> | |
158 <LTPDAalgorithm mcategory="Arithmetic Operator" mclass="ao" mname="rdivide" mpackage="" mversion="" portdims="2 -1 1 -1"/> | |
159 <plist UUID="80167ac1-26d3-450b-8e54-20f02a55d365" created="-1" description="" name="none"/> | |
160 </block> | |
161 <block UUID="1acd7c77-c7d2-42d6-8f4c-1a89ca2232c0" attachWorkbench="false" bounds="286 320 60 60" commentedOut="false" keepResult="true" keepresult="true" modifier="false" name="New Block_1"> | |
162 <port UUID="17c1077b-643b-464c-90ae-e37eb1b14efe" bounds="0 0 10 10" name="" number="0" terminal="" type="input"> | |
163 <node UUID="49f2e277-0413-4015-8829-c7b1daca68aa" bounds="241 247 136 106" name=""> | |
164 <pipe bezier="false" color="-3657166" dstPortUUID="17c1077b-643b-464c-90ae-e37eb1b14efe" dstblock="New Block_1" dstport="0" srcPortUUID="9d7a78c0-e32d-4118-a837-7cdb8e878b95" srcblock="rat" thickness="2.0"/> | |
165 </node> | |
166 </port> | |
167 <LTPDAalgorithm mcategory="Output" mclass="ao" mname="iplot" mpackage="" mversion="" portdims="1 -1 0 -1"/> | |
168 <plist UUID="ad48913d-e90d-40c3-a27f-0889fb7c7baf" created="-1" description="" name="none"/> | |
169 </block> | |
170 <matblock UUID="65ae2281-fbba-4ced-b919-22e13aa5c03b" bounds="140 217 60 60" commentedOut="false" expression="2" keepResult="true" keepresult="true" name="two"> | |
171 <port UUID="74188127-e5c7-403c-ad41-4fbf11d9fa26" bounds="0 0 10 10" name="" number="0" terminal="" type="output"> | |
172 <node UUID="fed5365d-7357-4318-b8df-542f91678649" bounds="188 210 30 40" name=""> | |
173 <pipe bezier="false" color="-3657166" dstPortUUID="ab07fec4-b49a-4a98-8dc2-c920a6c6b994" dstblock="a2" dstport="1" srcPortUUID="74188127-e5c7-403c-ad41-4fbf11d9fa26" srcblock="two" thickness="2.0"/> | |
174 </node> | |
175 </port> | |
176 </matblock> | |
177 <annotation UUID="bc8683ac-0345-403b-a3fd-9f04eeaca845" backgroundColor="255 255 255" bounds="399 19 445 512" fontName="Times" fontSize="15" fontStyle="0" foregroundColor="51 204 0" name="" text="function test_fft()
% Test fft() operator for AOs.
%
% M Hewitson 19-04-07
% 
% $Id: test_ao_fft.lwb,v 1.4 2011/04/27 07:05:20 hewitson Exp $
% 


%% Make test AOs

nsecs = 10;
fs = 1000;

pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t) + randn(size(t))');

a1 = ao(pl);
a1 = a1.setName;


%% Take abs

a2 = abs(fft((a1))).^2;
a3 = psd(a1, plist('Nfft', 10000, 'Win', specwin('Rectangular', 10000)));

%% Plot
rat = a2./a3;

%%
iplot(rat, plist('YScales', 'lin'))
iplot(a2,a3)

%% Two-sided fft
a4 = fft(a1, plist('type', 'two'));
iplot(abs(a4), plist('XScales', {'All', 'lin'}));


% END"/> | |
178 </canvas> | |
179 </document> | |
180 <ExecutionPlan/> | |
181 </LTPDAworkbench> |