source: MML/trunk/machine/SOLEIL/Booster/getnu.m

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

To have a stable version on the server.

  • Property svn:executable set to *
File size: 561 bytes
Line 
1function [tunex tunez] = getnu(ibpm1,ibpm2)
2
3istart=27;
4iend=istart+1*512+1;
5val =getbpmrawdata( [1 2] ,'nodisplay','struct');
6
7xt=val.Data.X(1,istart:iend);
8zt=val.Data.Z(2,istart:iend) ;
9
10nf=iend-istart+1;
11fx=fft(xt); px=fx.*conj(fx)/nf; xf=(1:nf)/nf;
12fz=fft(zt); pz=fz.*conj(fz)/nf; zf=(1:nf)/nf;
13tunex=find(px==max(px))/nf
14tunez=find(pz==max(pz))/nf
15
16figure(110)
17subplot(1,2,1)
18plot(xf(2:nf/2),px(2:nf/2));
19%ylim([0 1]);
20grid on
21subplot(1,2,2)
22plot(zf(2:nf/2),pz(2:nf/2))
23suptitle(['TuneX= ' num2str(tunex) '            TuneZ= ' num2str(tunez)]);
24grid on
25
Note: See TracBrowser for help on using the repository browser.