ece210/hw6/fortune_favors_the_fontaine.m

12 lines
351 B
Matlab

function noise = fortune_favors_the_fontaine(Fs, duration)
% make some noise
output = "";
while strlength(output) < Fs*duration
[ret dirty_snippet] = unix('fortune');
% clean
snippet = regexprep(dirty_snippet, '[^A-Za-z]+', '');
output = strcat(output, snippet);
end
noise = normalize(letters2numbers(convertStringsToChars(output)));
end