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:
SAR polar formatting: using griddata

Subject: SAR polar formatting: using griddata

From: Joe McGlinchy

Date: 19 Jan, 2009 23:46:02

Message: 1 of 4

Hi everyone,

I am trying to polar format a phase history data set down to a rectangular grid to form an image. The data set is complex valued, but I have read that shouldn't matter using griddata. The data set is an 1800x1999 array. I have attempted to compute the location of each sample in the frequency domain in polar coordinates, convert that to rectangular, and use griddata from there. I am getting errors for OUT OF MEMORY, and errors using qhullmx as well. here is my code as of now

%number of samples per pulse, 1800. 1999 pulses
rf = Beff*(double((0.0:1.0:nsamps-1))-nsamps/2)/nsamps + Bc;
thetaf = dtheta*double((0.0:1.0:npulses-1))/npulses+theta_1;

[thetaF,rF] = meshgrid(thetaf,rf);

[X,Y] = pol2cart(thetaF,rF);

XI = (0:10:1800);
YI = (0:10:1999)';
Z = phase_vector;
ZI = griddata(X,Y,Z,XI,YI,'nearest');

is there a problem with the arguments X,Y in griddata being matrices instead of row and column vectors? the help file in matlab is not too helpful in describing the format the arguments need to be in.

Any help would be appreciated, thanks!

Joe

Subject: SAR polar formatting: using griddata

From: Sadik

Date: 20 Jan, 2009 00:25:04

Message: 2 of 4

"Joe McGlinchy" <jxm8863@rit.edu> wrote in message <gl33bq$hi4$1@fred.mathworks.com>...
> Hi everyone,
>
> I am trying to polar format a phase history data set down to a rectangular grid to form an image. The data set is complex valued, but I have read that shouldn't matter using griddata. The data set is an 1800x1999 array. I have attempted to compute the location of each sample in the frequency domain in polar coordinates, convert that to rectangular, and use griddata from there. I am getting errors for OUT OF MEMORY, and errors using qhullmx as well. here is my code as of now
>
> %number of samples per pulse, 1800. 1999 pulses
> rf = Beff*(double((0.0:1.0:nsamps-1))-nsamps/2)/nsamps + Bc;
> thetaf = dtheta*double((0.0:1.0:npulses-1))/npulses+theta_1;
>
> [thetaF,rF] = meshgrid(thetaf,rf);
>
> [X,Y] = pol2cart(thetaF,rF);
>
> XI = (0:10:1800);
> YI = (0:10:1999)';
> Z = phase_vector;
> ZI = griddata(X,Y,Z,XI,YI,'nearest');
>
> is there a problem with the arguments X,Y in griddata being matrices instead of row and column vectors? the help file in matlab is not too helpful in describing the format the arguments need to be in.
>
> Any help would be appreciated, thanks!
>
> Joe

Hello Joe,

help griddata says:

ZI = GRIDDATA(X,Y,Z,XI,YI) fits a surface of the form Z = F(X,Y) to the
    data in the (usually) nonuniformly-spaced vectors (X,Y,Z). GRIDDATA
    interpolates this surface at the points specified by (XI,YI) to produce
    ZI. The surface always goes through the data points. XI and YI are
    usually a uniform grid (as produced by MESHGRID) and is where GRIDDATA
    gets its name.
 
    XI can be a row vector, in which case it specifies a matrix with
    constant columns. Similarly, YI can be a column vector and it specifies
    a matrix with constant rows.

So, from here, my understanding is that X, Y and Z should be vectors, and XI, YI defined in your code looks fine.

1800*1999 is maybe too large to fit on a figure, but I cannot say for sure. It depressed my laptop, too. :))

Subject: SAR polar formatting: using griddata

From: Joe McGlinchy

Date: 20 Jan, 2009 00:35:05

Message: 3 of 4

thanks for the response. 1800x1999 isn't too big, at least using imshow. I forgot to mention I will be using ifftshift(ifft2(ZI,2048,2048)) to compute the inverse fourier transform of ZI (as soon as it works) and display the image with imshow

Subject: SAR polar formatting: using griddata

From: Sanjit Maitra

Date: 18 Apr, 2012 13:46:11

Message: 4 of 4

"Joe McGlinchy" wrote in message <gl33bq$hi4$1@fred.mathworks.com>...
> Hi everyone,
>
> I am trying to polar format a phase history data set down to a rectangular grid to form an image. The data set is complex valued, but I have read that shouldn't matter using griddata. The data set is an 1800x1999 array. I have attempted to compute the location of each sample in the frequency domain in polar coordinates, convert that to rectangular, and use griddata from there. I am getting errors for OUT OF MEMORY, and errors using qhullmx as well. here is my code as of now
>
> %number of samples per pulse, 1800. 1999 pulses
> rf = Beff*(double((0.0:1.0:nsamps-1))-nsamps/2)/nsamps + Bc;
> thetaf = dtheta*double((0.0:1.0:npulses-1))/npulses+theta_1;
>
> [thetaF,rF] = meshgrid(thetaf,rf);
>
> [X,Y] = pol2cart(thetaF,rF);
>
> XI = (0:10:1800);
> YI = (0:10:1999)';
> Z = phase_vector;
> ZI = griddata(X,Y,Z,XI,YI,'nearest');
>
> is there a problem with the arguments X,Y in griddata being matrices instead of row and column vectors? the help file in matlab is not too helpful in describing the format the arguments need to be in.
>
> Any help would be appreciated, thanks!
>
> Joe


Even I am having the the same issue. So how did you solved this issue.
Any help will be greatly appreciated.
Thank you.
Sanjit

Tags for 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