NaveedDSP
NaveedDSP

Reputation: 11

Using sinc interpolation in MATLAB for complex vector

I am using sinc interpolation for complex sinusoid. It is working fine for real part, but the imaginary part seems inverted.

t1=0:pi/10:2*pi;       % sample points
s1=exp(1i*t1);         % sampled signal
figure(1),subplot 211, plot(t1,real(s1),'o');
subplot 212, plot(t1,imag(s1),'o');

t2=linspace(0,2*pi,100);   % interpolation points, a total of 100.

[T2,T1]=ndgrid(t2,t1);

s2=sinc((T2-T1)*10/pi)*s1'; 

figure(1),subplot 211, hold on, plot(t2,real(s2),'.');
subplot 212, hold on, plot(t2,imag(s2),'.');

Blue circle: sample values; Red dots: interpolated values

Upvotes: 1

Views: 463

Answers (1)

Luis Mendo
Luis Mendo

Reputation: 112689

The problem is that you are using s1' (conjugate transpose) when you actually want s1.' (transpose).

This is a common mistake. More information here.

Upvotes: 2

Related Questions