Added frft functions towards codegen (c code on PS)

This commit is contained in:
canisio
2026-03-30 11:16:12 -03:00
parent 30b31509c1
commit 7b04d52204
90 changed files with 554 additions and 0 deletions

37
frft_codegen/bizinter.m Normal file
View File

@@ -0,0 +1,37 @@
function xint=bizinter(x)
N=length(x);
im = 0;
if sum(abs(imag(x)))>0
im = 1;
imx = imag(x);
x = real(x);
end
x2=x(:);
x2=[x2.'; zeros(1,N)];
x2=x2(:);
xf=fft(x2);
if rem(N,2)==1 %N = odd
N1=fix(N/2+1); N2=2*N-fix(N/2)+1;
xint=2*real(ifft([xf(1:N1); zeros(N,1) ;xf(N2:2*N)].'));
else
xint=2*real(ifft([xf(1:N/2); zeros(N,1) ;xf(2*N-N/2+1:2*N)].'));
end
if ( im == 1)
x2=imx(:);
x2=[x2.'; zeros(1,N)];
x2=x2(:);
xf=fft(x2);
if rem(N,2)==1 %N = odd
N1=fix(N/2+1); N2=2*N-fix(N/2)+1;
xmint=2*real(ifft([xf(1:N1); zeros(N,1) ;xf(N2:2*N)].'));
else
xmint=2*real(ifft([xf(1:N/2); zeros(N,1) ;xf(2*N-N/2+1:2*N)].'));
end
xint = xint + 1j*xmint;
end
xint = xint(:);
end