Merge pull request #9 from ltcptgeneral/bliou000-patch-1

generate white noise
This commit is contained in:
bliou000 authored and GitHub committed 2021-12-05 09:16:26 -08:00
commit 6c390ff604
1 file changed
+13
+13
View File
@@ -0,0 +1,13 @@
function x = generate_white(amplitude, fs, duration)
%GENERATE_WHITE: returns a matrix of sampled white noise
%CONTRIBUTORS:
%Benjamin Liou: Original author
%DOCUMENTATION:
% white noise can then be filtered to produce different hues of noises
%time domain matrix of random sample points between +-amplitude
x = amplitude * 2 * (rand(1, fs * duration) - 0.5);
end