mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-16 07:16:36 +00:00
3e3d9ec3af
Add test case for Kaiser window in MATLAB.
21 lines
525 B
Matlab
21 lines
525 B
Matlab
function val = modified_bessel(x)
|
|
|
|
% Mirrors operation as done in RetroArch. Verify accuracy against Matlab's
|
|
% implementation.
|
|
|
|
sum = zeros(size(x));
|
|
factorial = ones(size(x));
|
|
factorial_mult = zeros(size(x));
|
|
x_pow = ones(size(x));
|
|
two_div_pow = ones(size(x));
|
|
x_sqr = x .* x;
|
|
|
|
for i = 0 : 17
|
|
sum = sum + x_pow .* two_div_pow ./ (factorial .* factorial);
|
|
factorial_mult = factorial_mult + 1.0;
|
|
x_pow = x_pow .* x_sqr;
|
|
two_div_pow = two_div_pow * 0.25;
|
|
factorial = factorial .* factorial_mult;
|
|
end
|
|
|
|
val = sum; |