Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f=1000;
- Fs=48000; %48kHz
- L=2000; %wartosc do testowania
- T=1/Fs; %odleglosc miedzy probkami
- t=[1:L-1]*T; %wektor kolejnych chwil czasowych
- X=1*sin(2*pi*f*t);
- Y=fft(X);
- P2 = abs(Y/L);
- P1 = P2(1:L/2+1);
- P1(2:end-1) = 2*P1(2:end-1);
- f = Fs*(0:(L/2))/L;
- title('Single-Sided Amplitude Spectrum of X(t)')
- xlabel('f (Hz)')
- ylabel('|P1(f)|')
- subplot(2,1,1);
- plot(X)
- subplot(2,1,2);
- plot(f,P1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement