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