Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [modu,argu]=SerieFourBi(signal,N)
- %*************************************************************************
- %Cette fonction calcule et représente le spectre bilatéral
- %(coefficients ck)d'un signal périodique.
- %Syntaxe: [MonAmpl, MonArg] = SerieFourBi(MonSign,N)
- %
- %> N est le nombre de points (taille de la fenêtre temporelle),
- % représente donc la période du signal.
- %> MonSign est la variable_tableau contenant le signal fonction du temps
- %
- %> MonAmpl et MonArg sont les tableaux de sortie récupérant le module
- % et l'argument des coefficients de Fourier ck.
- %*************************************************************************
- char('Taper: help SerFourBi_0');
- N=1024;
- t=0:N-1;
- x=Cren01(0.25,1024,4);
- subplot(3,1,1);
- plot(t,x);
- grid on;
- xlabel('t en µs');
- ylabel('signal');
- pause
- z= fft(x,N)/N;
- for n=1:N/2
- y(n+N/2)=z(n);
- end
- for n=N/2+1:N
- y(n-N/2)=z(n);
- end
- modu=abs(y);
- argu=angle(y);
- f=t-N/2;
- subplot(3,1,2);
- plot(f,argu);
- xlabel('f en MHz');
- ylabel('Argument');
- AXIS([-500 500 -4 4]);
- subplot(3,1,3);
- plot(f,modu);
- xlabel('f en MHz');
- ylabel('SPECTRE (module)');
- AXIS([-50 50 0 0.35]);
- %3/Amélioration du programme
- v=0;
- for i=1:1024
- v=v+modu(i);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement