Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
complex vector interpolation

Subject: complex vector interpolation

From: Pawel P.

Date: 25 Jul, 2003 12:50:52

Message: 1 of 7

Hello All

I have a complex vector, this is the complex numbers
corresponding to a frequency vector.


I would like to interpolate the complex vector at the points
between the frequency vector.

Is it OK, when I interpolate at first the Re() and then Im()? Or
I shell do it in different way.

Thanks in advance.
PP

Subject: complex vector interpolation

From: Ken Davis

Date: 25 Jul, 2003 07:59:27

Message: 2 of 7

"Pawel P." <usunto_kwartapaw@poczta.onet.pl> wrote in message
news:3F210B8C.451416A2@poczta.onet.pl...
> Hello All
>
> I have a complex vector, this is the complex numbers
> corresponding to a frequency vector.
>
>
> I would like to interpolate the complex vector at the points
> between the frequency vector.
>
> Is it OK, when I interpolate at first the Re() and then Im()? Or
> I shell do it in different way.
>
> Thanks in advance.
> PP
>
>
Use interp1 on your complex data. This will automatically interpolate real
and imag separately. - Ken

Subject: complex vector interpolation

From: Aslak Grinsted

Date: 25 Jul, 2003 08:00:09

Message: 3 of 7

I'd probably interpolate phase and magnitude instead. Depending on
what exactly you are doing you should unwrap your phase-angles first.
(type help unwrap)

Subject: complex vector interpolation

From: Pawel P.

Date: 25 Jul, 2003 14:39:29

Message: 4 of 7

>
> Use interp1 on your complex data. This will automatically interpolate real
> and imag separately. - Ken

Thank you very much.
It is funny, because bofore I rote this mail, I checked interp1 towrds this,
by copying the example from help interp1 and changing y to be complex.
I quickly checked the matlab window where the bed warning about the :
"Warning: Imaginary parts of complex X and/or Y arguments ignored."

Without any other ideas I post a message.
After your answer I started to think that there is something wrong, so it was.
The message came from plot function :)

regards
Pawel

Subject: complex vector interpolation

From: Pawel P.

Date: 25 Jul, 2003 15:02:45

Message: 5 of 7

I checked up the interp1 and see what I found:
check it up:

x = 0:10;
y = sin(x)+ cos(x).^2*i;
ym= abs(y);% oryginal
yp=angle(y);% oryginal

xi = 0:.25:10;
yi = interp1(x,y,xi,'spline');
yim=abs(yi); % magnitude of interpolated complex
yip=angle(yi);% phase of interpolated complex


ymi = interp1(x,ym,xi,'spline'); % interpolated magnitude
ypi = interp1(x,yp,xi,'spline');% interpolated phase

subplot(2,1,1);
plot(x,ym,xi,ymi,'o',xi,yim,'x')
subplot(2,1,2);
plot(x,yp,xi,ypi,'o',xi,yip,'x')

only sepratated interpolations give good result. Interp1(on
complex) does not work!

regards
Pawel

Subject: complex vector interpolation

From: Pawel P.

Date: 25 Jul, 2003 15:27:34

Message: 6 of 7

I have something better.

Finally I realised what does to interpolate complex variables.
There are two ways of doing this. One coresponds to interpolation
in polar coordinates and one interpolates between rectengular
coordinates.
The interp1, interpolates in rectengular coordinates, although my
previous example was in polar coordinates.

Matlab applies the interpolation for Real and Imag part
separatelly. Which is different from applying the interpolation
to magnitude and phase.

regards
Pawel

Subject: complex vector interpolation

From: Kiung Chung

Date: 23 Jul, 2013 01:05:10

Message: 7 of 7

Hi,

but, which one is the correct one ? what is the criteria to choose to interpolate between retangular form or polar form ?

but, my own opinion is polar form will be better if we want to taking care of the phase unwrapping.

rgds,
kc Wong

"Pawel P." <usunto_kwartapaw@poczta.onet.pl> wrote in message <3F213046.3729436B@poczta.onet.pl>...
> I have something better.
>
> Finally I realised what does to interpolate complex variables.
> There are two ways of doing this. One coresponds to interpolation
> in polar coordinates and one interpolates between rectengular
> coordinates.
> The interp1, interpolates in rectengular coordinates, although my
> previous example was in polar coordinates.
>
> Matlab applies the interpolation for Real and Imag part
> separatelly. Which is different from applying the interpolation
> to magnitude and phase.
>
> regards
> Pawel
>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us