1 | function [pxfft,pzfft,Xintegrale_bpm,Zintegrale_bpm,f_bpm]=fft_and_noise_calcul_group(bufferX,bufferZ,fech) |
---|
2 | |
---|
3 | Nbpm=size(bufferX,1); |
---|
4 | Nsamples=size(bufferX,2); |
---|
5 | f_bpm=(1:Nsamples-1)*fech/Nsamples; |
---|
6 | |
---|
7 | xfft(1:Nbpm,1:Nsamples)=0; |
---|
8 | zfft(1:Nbpm,1:Nsamples)=0; |
---|
9 | pxfft(1:Nbpm,1:Nsamples)=0; |
---|
10 | pzfft(1:Nbpm,1:Nsamples)=0; |
---|
11 | %pxfftaff(1:Nbpm,1:Nsamples)=0; |
---|
12 | %pzfftaff(1:Nbpm,1:Nsamples)=0; |
---|
13 | %PXintegrale_bpm(1:Nbpm,1:Nsamples)=0; |
---|
14 | %PZintegrale_bpm(1:Nbpm,1:Nsamples)=0; |
---|
15 | Xintegrale_bpm(1:Nbpm,1:Nsamples)=0; |
---|
16 | Zintegrale_bpm(1:Nbpm,1:Nsamples)=0; |
---|
17 | |
---|
18 | |
---|
19 | xfft=fft(double(bufferX)./1000,[],2)/Nsamples; |
---|
20 | zfft=fft(double(bufferZ)./1000,[],2)/Nsamples; |
---|
21 | %xfft=fft(double(bufferX),[],2)/Nsamples; |
---|
22 | %zfft=fft(double(bufferZ),[],2)/Nsamples; |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | pxfft=2*xfft.*conj(xfft); |
---|
27 | pzfft=2*zfft.*conj(zfft); |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | %on normalise pour afficher la dsp en µm^2/Hz et non pas en µm^2/largeur de bande entre 2 échantillons |
---|
32 | %pxfftaff(j,:)=sqrt(pxfft(j,:)*Nsamples/fech); |
---|
33 | %pzfftaff(j,:)=sqrt(pzfft(j,:)*Nsamples/fech); |
---|
34 | %pxfftaff=sqrt(pxfft); |
---|
35 | %pzfftaff=sqrt(pzfft); |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | for step=2:Nsamples |
---|
40 | Xintegrale_bpm(:,step)=Xintegrale_bpm(:,step-1) + pxfft(:,step); |
---|
41 | Zintegrale_bpm(:,step)=Zintegrale_bpm(:,step-1) + pzfft(:,step); |
---|
42 | end |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | pxfft=sqrt(pxfft); |
---|
47 | pzfft=sqrt(pzfft); |
---|
48 | Xintegrale_bpm=sqrt((Xintegrale_bpm)); |
---|
49 | Zintegrale_bpm=sqrt((Zintegrale_bpm)); |
---|
50 | |
---|
51 | |
---|
52 | |
---|