Code covered by the BSD License

### Highlights from Radially averaged power spectrum of 2D real-valued matrix

5.0
5.0 | 5 ratings Rate this file 34 Downloads (last 30 days) File Size: 2.09 KB File ID: #23636 Version: 1.5

# Radially averaged power spectrum of 2D real-valued matrix

### Evan Ruzanski (view profile)

12 Apr 2009 (Updated )

Computes and plots radially averaged PSD of 2-D real matrix with a given spatial resolution.

File Information
Description

The radially averaged power spectrum (RAPS) is the direction-independent mean spectrum, i.e. the average of all possible directional power spectra. The radially averaged power spectrum provides a convenient means to view and compare information contained in 2-D spectra in 1-D. This function computes and plots the RAPS of an input matrix (does not consider corner values outside averaging radius). The image can be rectangular but must be 2-D (e.g., multi-color channel data is not supported). The spatial resolution of the data is also specified.

MATLAB release MATLAB 7.3 (R2006b)
02 Jun 2016 gianrocco lazzari

### gianrocco lazzari (view profile)

Comment only
23 May 2016 edo prasetyo

04 May 2016 f e

Thanks

10 Feb 2016 Amos

### Amos (view profile)

19 Apr 2014 Jim Kasson

### Jim Kasson (view profile)

17 Apr 2013 Joao Marcos

### Joao Marcos (view profile)

Also, even my region is ~1000km the spectrum shows energy up to 5000km...

Comment only
17 Apr 2013 Joao Marcos

### Joao Marcos (view profile)

Thank you for the file, it was very usefull.
I runned a test where I linearly interpolate a 50km wind data to 5km. I would expect a drop in the energy at 100km, but the spectra shows eenrgy cascating down to the 5km scale. Do you know why this happens?
Thank you

Comment only
03 Apr 2013 fong

### fong (view profile)

useful for understanding RAPSD to analysis the spectral characteristics of a halftone pattern?

16 Aug 2011 Angjelina Protik

### Angjelina Protik (view profile)

for r = 0:floor(dimMax/2)
i{r + 1} = find(rho == r);
end
Pf = zeros(1, floor(dimMax/2)+1);
for r = 0:floor(dimMax/2)
Pf(1, r + 1) = nanmean( imgfp( i{r+1} ) );
end
there is some bug in this part

Comment only
06 Apr 2011 Stefano

### Stefano (view profile)

Hi, I found this to be faster, hope it helps, S.
%% code for fast radial averaging:
[xx,yy]=meshgrid(-1000:1000,-1000:1000);
rr=sqrt(xx.^2+yy.^2);
ri=floor(rr/100)+1;
N=numel(ri);
[~,~,iir]=unique(ri); %find unique values
Qt =sparse(1:N,iir,ones(N,1));

Comment only
15 Apr 2009 1.1

The radially averaged power spectrum provides a convenient means to view and compare information contained in 2D spectra in 1D.

17 Jun 2009 1.2

Rectangular matrices can now be input; spatial resolution can be specified.

17 Jun 2009 1.3

Fixed bug in x-axis of plot; preallocated memory for axes label cells; removed minor ticks from y-axis; cleaned up comments.

16 Mar 2011 1.4

Added feature to handle odd/even dimensionality differences of input matrix

17 Mar 2011 1.5

Clarified restrictions on input to the file description (e.g., multi-channel data from JPG, etc. is not supported)