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
+18
View File
@@ -0,0 +1,18 @@
function eval_vcf_lut()
N = 1000;
fs = 48000;
fmin = 18;
fmax = 18000;
sweepbase = 10;
filterParam = struct('sweepbase', 10, 'omega_min', 2*fmin/fs, 'omega_max', 2*fmax/fs, 'num_octaves', log(fmax/fmin)/log(sweepbase));
filterParam
cv = (0:N-1)/N;
plot (c
function cv = omega2cv(filterParam, omega)
cv = log(omega/filterParam.omega_min)/(filterParam.num_octaves * log(filterParam.sweepbase));
cv = min(1, max(0, cv));
function omega = cv2omega(filterParam, cv)
omega = filterParam.omega_min*filterParam.sweepbase ^ (filterParam.num_octaves*min(1, max(0, cv)));
+23
View File
@@ -0,0 +1,23 @@
function eval_vcf_lut()
N = 1000;
fs = 48000;
fmin = 18;
fmax = 18000;
sweepbase = 10;
filterParam = struct('sweepbase', 10, 'omega_min', fmin/fs, 'omega_max', fmax/fs, 'num_octaves', log(fmax/fmin)/log(sweepbase));
filterParam
cv = (0:N-1)/N;
subplot(2, 1, 1)
plot (cv, fs*cv2omega(filterParam, cv)); grid; legend('F'); xlabel('cv');
subplot(2, 1, 2)
plot (cv, cos(2*pi*cv2omega(filterParam, cv)), cv, sin(2*pi*cv2omega(filterParam, cv))); grid; legend('kc', 'ks'); xlabel('cv');
function cv = omega2cv(filterParam, omega)
cv = log(omega/filterParam.omega_min)/(filterParam.num_octaves * log(filterParam.sweepbase));
cv = min(1, max(0, cv));
function omega = cv2omega(filterParam, cv)
omega = filterParam.omega_min*filterParam.sweepbase .^ (filterParam.num_octaves*min(1, max(0, cv)));