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