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

조회 수: 17 (최근 30일)
Utpal Mozumder
Utpal Mozumder 2020년 10월 21일
댓글: Utpal Mozumder 2020년 10월 21일
I want to add some artificially noise of specific frequency. Can someone help?

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 10월 21일
편집: Ameer Hamza 2020년 10월 21일
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);
  댓글 수: 2
Utpal Mozumder
Utpal Mozumder 2020년 10월 21일
Thanks a lot
Utpal Mozumder
Utpal Mozumder 2020년 10월 21일
Is it possible to shift the phase of the original signal with this noise?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2020년 10월 21일
L = 60 ; % Length in sec
f = 60 ; % Frequency in Hz
Fs = 10000 ; % Sampling Frequency
t = linspace(0, L, Fs*len); % time Vector
x = sin(2*pi*f*t);
noise = x + 0.1*randn(size(x));

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by