Generate signal with noise

MATLAB programming related topics
Post Reply
User avatar
amh
Site Admin
Posts: 263
Joined: Thu Jan 06, 2022 12:35 am

Generate signal with noise

Post by amh »

An example of generating signal with noise

Code: Select all

fs = 1000;                                % sample frequency (Hz)
t = 0:1/fs:10-1/fs;                      % 10 second span time vector
x = (1.3)*sin(2*pi*15*t) ...             % 15 Hz component
  + (1.7)*sin(2*pi*40*(t-2)) ...         % 40 Hz component
  + 2.5*randn(size(t));                  % Gaussian noise;
Post Reply