%sigpwgn1.m display('Running...sigpwgn1'); t = 0:0.015:10 ; % Time vector x = sin(7*t); % Signal %add white gaussian noise sigma=0.2; L=length(x); n=randn(1,L); y=x+sigma*n; %signal plus noise %plot time domain subplot(2,1,1) plot(t,y), title('signal - time domain'); %FFT ffty = fft(y); % Compute DFT of y my = abs(ffty); py = unwrap(angle(ffty)); % Magnitude and phase f = (0:length(ffty)-1)/length(ffty); % Frequency vector subplot(2,1,2) plot(f,my); title('signal - frequency domain');