MATLAB: Generate Specific noise(i.e. 60 or 70 Hz) Matlab

noise

I want to add some artificially noise of specific frequency. Can someone help?

Best Answer

If you just want to add a specific frequency noise in you signal then try this
f = 5;
fn = 60;
t = linspace(0, 1, 200);
y = sin(2*pi*f*t);
yn = 0.2*sin(2*pi*fn*t);
y = y + yn;
plot(t, y)
Check the fft() of the signal and you will see peaks at 5Hz (original signal) and 60Hz (noise)
Fs = 1/(t(2)-t(1));
fv = linspace(0, 1, numel(t))*Fs;
mag = abs(fft(y));
plot(fv, mag);