Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Widmo amplitudowe syngalu w zakresie 0-fp
- clear;
- N = 400;
- fp = 1000;
- t = 0:1/fp:(N-1)/fp;
- %Suma sinusow i szumow
- x= 6*sin(2*pi*250*t) + 3*sin(2*pi*350*t) + 2*randn(1,N);
- subplot(2, 1, 1);
- plot(t, x);
- xlabel('czas[s]');
- ylabel('sygnal');
- % Widmo
- Nf= 1024;
- v = fft (x, Nf); % Widmo zespolone
- w = abs (v); % Widmo amplitudowe
- f = linspace (0, fp, Nf); %generowanie osi czestotliwosci
- subplot(212);
- plot (f, w);
- xlabel('czestotliwosc [Hz]');
- ylabel('modul widma');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement