4.33333

4.3 | 3 ratings Rate this file 170 downloads (last 30 days) File Size: 3.1 KB File ID: #4658

updownsample

by Ohad Gal

 

21 Mar 2004 (Updated 22 Nov 2004)

Code covered by BSD License  

up/down sample an input matrix using the fourier domain.

Download Now | Watch this File

File Information
Description

Up/down sample an image/matrix/vector (can be of complex numbers) using the frequency domain.
The matrix/vector should be continuous of a high degree (has continuous derivatives) in order to obtain a reasonable up/down sampling

Speed-up can be achieved if the user up-samples to a near power of 2. no optimization is done inside this code for efficient fft usage.

Documentation is found inside the *.m file.

type "updownsample" for the example

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
fft_upsample

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
09 Apr 2004 Aaron Clarke

Nice function. Works great.

10 Apr 2004 Ahmed Zakzouk

nice work

12 Jan 2005 David Felguera

Problems with circular convolutions ...

Just try:

in_m = ones(10,10);
in_m = [zeros(10,10);in_m;zeros(10,10)];
in_m = [in_m,zeros(30,10)];
figure(100);
imagesc(in_m);
out_x_sz = 320;
out_y_sz = 320;
out_m = updownsample( in_m,out_x_sz,out_y_sz,0,1);
figure(200);
imagesc(out_m);

I dont know exactly if its a circular convolution but it seems to. (could be some kind of aliasing too, when processing some kind of images)

14 Sep 2007 Jeroen Corthout  
Please login to add a comment or rating.
Updates
22 Nov 2004

I found a linear phase distortion in the output image (only when looking at a complex or real output image), due to spatial misplace of the input image in the fourier domain

Tag Activity for this File
Tag Applied By Date/Time
geometric transformation Ohad Gal 22 Oct 2008 07:16:52
image registration Ohad Gal 22 Oct 2008 07:16:52
upsample downsample fourier interpolation Ohad Gal 22 Oct 2008 07:16:52
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com