source: MML/trunk/machine/SOLEIL/common/synchro/check_boo_synchro.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: 586 bytes
Line 
1function [flag]=check_boo_synchro
2% Estime amplitude sur tune synchro
3ampmax=180; % sur fft
4%ampmax=3; % sur max x en mm
5
6temp=tango_read_attribute2('BOO-C03/DG/BPM.03','XPosDD');
7X = temp.value;
8
9istart   = 20;
10nbpoints = 256;
11iend     = istart + nbpoints-1;
12Xval(1:nbpoints) = X(istart:iend);
13
14% % fft
15Xfft     = fft(Xval,nbpoints);
16PXfft    = Xfft.* conj(Xfft) / nbpoints;
17PXfft([1 2 nbpoints]) = 0; %% ???
18amp=max(PXfft(1:20));
19ampf=amp;
20
21% max X
22% Xval=Xval-mean(Xval);
23% amp=max(abs(Xval));
24
25%fprintf('%8.3f    %8.3f \n',ampf, amp)
26
27if amp>ampmax
28    flag=1;
29else
30    flag=0;
31end
Note: See TracBrowser for help on using the repository browser.