# littlewoodPaleySum

Littlewood-Paley sum

## Syntax

``lpsum = littlewoodPaleySum(sf)``
``lpsum = littlewoodPaleySum(sf,fb)``
``[lpsum,fx,fy] = littlewoodPaleySum(___)``

## Description

````lpsum = littlewoodPaleySum(sf)` returns the Littlewood-Paley sum for the 2-D filter banks in the 2-D wavelet scattering network `sf`.Because the scattering transform is contractive, the Littlewood-Paley sums do not exceed 1.```
````lpsum = littlewoodPaleySum(sf,fb)` returns the Littlewood-Paley sum for the specified filter banks `fb`.```

example

````[lpsum,fx,fy] = littlewoodPaleySum(___)` returns the spatial frequencies in the x- and y-directions for the Littlewood-Paley sum.```

## Examples

collapse all

This example shows how to obtain and display the Littlewood-Paley sum of an image scattering network.

Create a scattering network with two filter banks and quality factors of 2 and 1, respectively.

`sf = waveletScattering2(QualityFactors=[2 1]);`

Obtain the Littlewood-Paley sums and spatial frequencies of the two filter banks. Display the maximum value of the sums. Since the scattering transform is contractive, the sums do not exceed 1.

```[lpsum,fx,fy] = littlewoodPaleySum(sf); max(max(lpsum(:,:,1)))```
```ans = single 1.0000 ```
`max(max(lpsum(:,:,2)))`
```ans = single 1.0000 ```

Display the Littlewood-Paley sum of the second filter bank with the zero frequency centered. Note the 2-D Morlet filter bank used in the scattering transform is not designed to capture the highest spatial frequencies jointly in the x- and y-directions.

```fx(fx>1/2) = fx(fx>1/2)-1; fy(fy>1/2) = fy(fy>1/2)-1; surf(fftshift(fx),fftshift(fy),fftshift(lpsum(:,:,2))) shading interp view(0,90) xlabel("f_x") ylabel("f_y") colorbar title("Q=1")```

## Input Arguments

collapse all

Wavelet image scattering network, specified as a `waveletScattering2` object.

Filter bank indices in the image scattering network, specified as a positive integer or vector of positive integers between 1 and `numfilterbanks(sf)` inclusive. The number of filter banks in `sf` is equal to the number of specified `QualityFactors` in `sf`.

## Output Arguments

collapse all

Littlewood-Paley sum for the filter banks in the image scattering network `sf`, returned as a real-valued 3-D array. `lpsum` is an M-by-N-by-L array, where M-by-N is the matrix size of the padded filters and L does not exceed the number of filter banks in `sf`. If you specify indices `fb`, L is the number of unique elements in `fb`. Otherwise, L is the number of filter banks.

Since R2024a

Spatial frequencies for the Littlewood-Paley sum, returned as a pair of real-valued vectors. `fx` and `fy` are the spatial frequencies in the x- and y- dimensions, respectively. Frequencies are in cycles per pixel. In this convention, the Fourier transform is 1-periodic in both Fourier variables.

## Version History

Introduced in R2019a

expand all