multidimensional smooth rows vs columns

I am confused about the smooth operation on 2D matrices:
make/o/n=(5,5) data=0; data[2][2]=1
smooth/dim=1 2, data// according to smooth help, 'operate along columns'
edit data// data has the center row smoothed

So, does 'operate along columns' equals 'smooth each row individualy' (seems confusing)? Or is it a typo in the help?

Thanks,
Fabrizio
Your test case (with one non-zero data point in the center of the wave) is a little limited to be drawing broad conclusions. Smooth/dim=0 or Smooth/dim=1 work properly, smoothing along the specified dimension for each entry of the other dimension (i.e., either all rows or all columns are smoothed). I see no way to smooth one selected row or one selected column using Smooth/dim.

If you want to restrict the smooth operation to a particular row or column, I suggest first using the MatrixOP operation to select either a row or column into a one-dimensional destination wave, then apply Smooth, and refresh your starting 2D wave row or column.
I guess it's really more of a semantics questions.

I assume that rows are horizontal 'lines' in a igor table, and columns are vertical 'lines'.
The behavior i see (which i think is demonstrated by my little test case - please correct me if I'm wrong) is:
'smooth/dim=0' is documented as operating along rows (from the help: /Dim=d ... For d=0, 1,…, operates along rows, columns, etc.).
'smooth/dim=0' smooths column by column (i.e. each column is replaced with the smoothed column)
My confusion was that I interpreted 'operate along rows' to smooth row by row.

To further add to the confusion, the /dim flag is also described for some other operations as follows:

'differentiate' and 'integrate'
For d=0, 1, 2, 3, Differentiate operates along rows, columns, layers or chunks.
For example, for a 2D wave, /DIM=0 differentiates each row and /DIM=1 differentiates
each column.

To me, it looks as if differentiate/dim=0 differentiates each column (which would be in accordance with the 'smooth' behavior)

'FilterFIR', 'FilterIIR', 'Resample'
For d=0, 1,…, operates along rows, columns, etc.
Use /DIM=0 to apply the filter to each individual column (each one a channel, say left
and right) in a multidimensional waveName where each row comprises all of the sound
samples at a particular time.


Also, if 'along rows' means column-by-column, how does this logic work for 3d+ waves? For smooth, wouldn't this imply that using /dim=n, the smooth kernel has M-1 dimensions for an M-dimensional wave? (A quick test shows that for a 3d wave, smooth/dim=0 still operates column-by-column with a 1d kernel)

- Fabrizio

fabrizio wrote:
I guess it's really more of a semantics questions.

Also, if 'along rows' means column-by-column, how does this logic work for 3d+ waves?
- Fabrizio


We use the phrase "along rows" to mean "iterate over values row-by-row, in a column" or (sometimes) columns.

This is pretty much the same terminology Microsoft uses to describe their spreadsheets.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.