added matlab

This commit is contained in:
2025-08-21 07:27:52 +02:00
parent fd522e1b99
commit 64c6745c76
50 changed files with 2516 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
function eval_lfo2()
L = 80000;
fs = 48000;
fstart = 10;
fend = 5000;
df = (fend-fstart)/L;
ip = 0.0 % phase of the first output sample in radians
% Init
% Loop
f = fstart;
fchg = 0;
ylast = 0;
a = 0.5;
b = 2.0 * sin(f*pi / fs);
y0 = a*cos(2*pi*ip);
y1 = a*sin(2*pi*ip);
for n=1:L,
y0 = y0 - b*y1;
y1 = y1 + b*y0;
fchg = (mod(n, 1000) == 0);
if fchg
b = 2.0 * sin(f*pi / fs);
end
ylast = y1;
lfo(n) = y0;
f = f + df;
close all
end;
figure;
plot(1:L, lfo); grid;
wavwrite(0.5*lfo, fs, 'lfo.wav');