-
Notifications
You must be signed in to change notification settings - Fork 0
CRONE
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.
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
For 2D images, the operator computes the fractional derivative along both axes.
-
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
GLcoeffsfunction and arranged symmetrically for correct fractional behavior. -
Mode: Convolution is performed in
"same"mode to preserve the input size.
CRONE(
alpha: float,
f_name: np.ndarray
) -> np.ndarray-
alpha (
float): The order of the fractional derivative. -
f_name (
np.ndarray): The input signal (1D) or image (2D).
-
For 1D input:
- (
np.ndarray) The filtered signal (same shape as input).
- (
-
For 2D input:
- (
tupleofnp.ndarray) The filtered image in the x and y directions, respectively.
- (
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)- 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.
- Mathieu, B., Melchior, P., Oustaloup, A., and Ceyral, Ch. (2003). Fractional differentiation for edge detection. Signal Processing, 83, pp. 2421–2432.