source: MML/trunk/machine/SOLEIL/common/naff/nafflib/naff_example.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 719 bytes
Line 
1function naff_example
2% Example to test naff within matlab
3
4NT = 9996; % divided by 6
5
6% simple quasiperiodic (even period) motion
7y =2+0.1*cos(pi*(0:NT-1))+0.00125*cos(pi/3*(0:NT-1));
8yp=2+0.1*sin(pi*(0:NT-1))+0.00125*sin(pi/3*(0:NT-1));
9
10[nu ampl phase] = calcnaff(y,yp,1,'Debug'); % with windowing
11
12str = [
13'NFS = 3\n' ...
14'AMPL= 2.000000e+00+i* 2.000000e+00 abs(AMPL)= 2.828427e+00 arg(AMPL)= 7.853982e-01 FREQ= 3.904977e-17\n'...
15'AMPL= 1.000000e-01+i* 5.638068e-13 abs(AMPL)= 1.000000e-01 arg(AMPL)= 5.638068e-12 FREQ=-3.141593e+00\n' ...
16'AMPL= 1.250000e-03+i*-4.767346e-14 abs(AMPL)= 1.250000e-03 arg(AMPL)=-3.813877e-11 FREQ= 1.047198e+00\n' ...
17];
18fprintf('* one should get the following *\n');
19fprintf(str);
Note: See TracBrowser for help on using the repository browser.