How to add low frequency noise to the signal?
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
632541
am 16 Sep. 2021
Beantwortet: Mathieu NOE
am 16 Sep. 2021
How to add low frequency noise (less than 3Hz) to signal in matlab?
0 Kommentare
Akzeptierte Antwort
Mathieu NOE
am 16 Sep. 2021
hello
this is a simple demo showing a sine signal corrupted by a low frequency noise . You can adjust the parameters to your own needs
Fs = 1000;
samples = 10000;
dt = 1/Fs;
t = (0:samples-1)*dt;
y = 3*sin(2*pi*1*t); % signal - adjust amplitude to your needs
noise = 1.5*randn(size(t)); % noise (before filtering) - adjust amplitude to your needs
% low pass filter : Butterworth filter
NN = 2; % filter order
fc = 3; % cut off frequency (Hz)
Wn = fc/(Fs/2); % normalized cut off frequency
[B,A] = butter(NN,Wn);
noise_filtered = filter(B,A,noise); % noise (after LP filtering)
y_noisy = y+noise_filtered; % signal + noise
figure(1)
plot(t,y,t,y_noisy);legend('signal','signal + noise');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulation, Tuning, and Visualization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!