35 lines
586 B
Matlab
Executable File
35 lines
586 B
Matlab
Executable File
function eval_smooth(Ta)
|
|
|
|
fs = 10000;
|
|
|
|
b = 1;
|
|
if (abs(Ta) > 0)
|
|
b = 1/(abs(Ta)*fs);
|
|
end;
|
|
|
|
a = 1 - b;
|
|
|
|
x = [ zeros(1, 1000) ones(1, 1000) zeros(1, 1000)];
|
|
N = length(x);
|
|
|
|
y = 0;
|
|
y1 = 0;
|
|
for i=1:length(x)
|
|
y1 = b*x(i) + a*y1;
|
|
% if (Ta > 0)
|
|
y1n(i) = y1;
|
|
% else
|
|
y2n(i) = 2*x(i) - y1;
|
|
% end
|
|
end;
|
|
|
|
subplot(3, 1, 1)
|
|
plot(1:N, x, 'r'); grid;
|
|
xlabel('Original LFO Wellenform (Square)')
|
|
subplot(3, 1, 2)
|
|
plot(1:N, y1n, 'r'); grid;
|
|
xlabel('Positive smoothed')
|
|
subplot(3, 1, 3)
|
|
plot(1:N, y2n, 'r'); grid;
|
|
xlabel('Negative smoothed')
|