spec_op function

Perform a mathematical operation on a spectral region.