Generate Specific noise(i.e. 60 or 70 Hz) Matlab
20 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Utpal Mozumder
le 21 Oct 2020
Commenté : Utpal Mozumder
le 21 Oct 2020
I want to add some artificially noise of specific frequency. Can someone help?
0 commentaires
Réponse acceptée
Ameer Hamza
le 21 Oct 2020
Modifié(e) : Ameer Hamza
le 21 Oct 2020
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 commentaires
Plus de réponses (1)
KSSV
le 21 Oct 2020
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));
0 commentaires
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!