Home > atphysics > nafflib > naff_example.m

naff_example

PURPOSE ^

Example to test naff within matlab

SYNOPSIS ^

function naff_example

DESCRIPTION ^

 Example to test naff within matlab

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function naff_example
0002 % Example to test naff within matlab
0003 
0004 NT = 9996; % divided by 6
0005 
0006 % simple quasiperiodic (even period) motion
0007 y =2+0.1*cos(pi*(0:NT-1))+0.00125*cos(pi/3*(0:NT-1));
0008 yp=2+0.1*sin(pi*(0:NT-1))+0.00125*sin(pi/3*(0:NT-1));
0009 
0010 [nu ampl phase] = calcnaff(y,yp,1,'Debug'); % with windowing
0011 
0012 str = [
0013 'NFS = 3\n' ...
0014 'AMPL= 2.000000e+00+i* 2.000000e+00 abs(AMPL)= 2.828427e+00 arg(AMPL)= 7.853982e-01 FREQ= 3.904977e-17\n'...
0015 'AMPL= 1.000000e-01+i* 5.638068e-13 abs(AMPL)= 1.000000e-01 arg(AMPL)= 5.638068e-12 FREQ=-3.141593e+00\n' ...
0016 'AMPL= 1.250000e-03+i*-4.767346e-14 abs(AMPL)= 1.250000e-03 arg(AMPL)=-3.813877e-11 FREQ= 1.047198e+00\n' ...
0017 ];
0018 fprintf('* one should get the following *\n');
0019 fprintf(str);

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005