Frequency interpolation

sinc function and dirichlet function

 

https://au.mathworks.com/help/signal/ref/sinc.html

https://au.mathworks.com/help/signal/gs/the-dirichlet-function.html

 

Matlab code

%% Frequency interpolation via Dirichlet function.
N = 8;
L = N*2;
x = randn(N,1);
X = fft(x);
wk = (0:N-1)/N*2*pi;
w = (0:L-1)/L*2*pi;
[Ts,T] = ndgrid(w,wk);
Y = diric((T-Ts),N)./exp(1i*(T-Ts)/2) *X;
% Y_half = Y(1:end/2+1);
% Y1 = spec_half2full(Y_half);
Y1 = Y;
y1 = ifft(Y1);
if sum( abs(imag(y1)) ) > 10^(-5)
error('ifft is wrong');
end
y1 = real(y1);
figure; hold on; plot(x,'-o'); plot(y1,'-*'); hold off

 

Last equation is wrong. 

 

posted @ 2016-12-02 04:59  sp4comm  阅读(185)  评论(0)    收藏  举报