vlt.math.fouriercoeffs-findFouriercoefficientsfordataUsesFFTtocomputetheFouriercoefficientsforavectorofdata.[FC,FREQS]=vlt.math.fouriercoeffs(DATA,SI)whereDATAisavectorofdataandSIisthesamplinginterval(inseconds),returnsFCtheFouriercoefficientsandFREQS,thefrequencyofeachcoefficient.TheFouriercoefficientsaredefined[1]tobe:B0=(1/T)*sum(data)(returnedinFC(1))Bn=(2/T)*integral(0,T,data.*cos(2*pi*n/T))(returnedinreal(FC(n+1)))An=(2/T)*integral(0,T,data.*sin(2*pi*n/T))(returnedinimag(FC(n+1)))EachentryofFCisthesumofBn+An*sqrt(-1)sothatBn=real(FC(n+1))andAn=imag(FC(n+1))NotethattheseFouriercofficientsarenormalizeddifferentlythanthosereturnedbytheMatlabfunctionFFT.[1]:_Waves_,BerkeleyPhysicsCourseVolume3,Crawford,1968Seealso:FFTExample:t=0:0.001:3;f=4;%4Hzphase=pi/3;s=2+0.5*sin(2*pi*f*t+phase);%sinusoidalfunctionwithamplitude0.5[fc,freqs]=fouriercoeffs(s,0.001);figure;subplot(2,1,1);plot(t,s);xlabel('Time(s)');ylabel('Signal(a.u.)');boxoff;subplot(2,1,2);plot(freqs,abs(fc),'o');A=axis;axis([01003]);xlabel('Frequency (Hz)');ylabel('Magnitude of Fourier coefficient');boxoff;