CRONE - iparsw/differintP GitHub Wiki
CRONE
– Fractional Derivative Approximation Using the CRONE Operator
Overview
CRONE
computes the Grünwald-Letnikov fractional derivative approximation using the CRONE operator. This method is particularly useful for signal processing and edge detection in 1D signals and 2D images.
The implementation follows the approach described in:
Mathieu, B., Melchior, P., Oustaloup, A., and Ceyral, Ch. (2003). Fractional differentiation for edge detection. Signal Processing, 83, pp. 2421–2432.
Mathematical Background
The CRONE operator is a convolution-based filter designed to approximate the Grünwald-Letnikov fractional derivative. It constructs the appropriate filter coefficients based on the desired fractional order $\alpha$ and applies them using convolution, either to 1D arrays (signals) or 2D arrays (images).
For 2D images, the operator computes the fractional derivative along both axes.
Implementation Details
-
Flexible Input:
- If the input (
f_name
) is a 2D array (image), the function computes the fractional derivative along both rows and columns. - If the input is a 1D array (signal), the function computes the fractional derivative along the array.
- If the input (
-
Filter Construction: The convolution filter is built using the
GLcoeffs
function and arranged symmetrically for correct fractional behavior. -
Mode: Convolution is performed in
"same"
mode to preserve the input size.
Function Signature
CRONE(
alpha: float,
f_name: np.ndarray
) -> np.ndarray
Parameters
- alpha (
float
): The order of the fractional derivative. - f_name (
np.ndarray
): The input signal (1D) or image (2D).
Returns
-
For 1D input:
- (
np.ndarray
) The filtered signal (same shape as input).
- (
-
For 2D input:
- (
tuple
ofnp.ndarray
) The filtered image in the x and y directions, respectively.
- (
Example Usage
import numpy as np
from differintP import CRONE
# Example 1: Fractional differentiation of a 1D signal
signal = np.linspace(0, 1, 100)
frac_diff = CRONE(0.5, signal)
# Example 2: Fractional edge detection on a 2D image
image = np.random.rand(256, 256)
imgx, imgy = CRONE(0.7, image)
Notes
- The CRONE operator is especially useful for edge detection and texture analysis in image processing.
- The implementation automatically adjusts the filter size for even/odd-length inputs.
- The order of the filter is chosen to match the input’s dimension and the desired fractional order.
- Input must be a 1D or 2D array.
References
- Mathieu, B., Melchior, P., Oustaloup, A., and Ceyral, Ch. (2003). Fractional differentiation for edge detection. Signal Processing, 83, pp. 2421–2432.