<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_imgfir",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_imgfir"
  },
  "title" : "vDSP_imgfir"
}
-->

# vDSP_imgfir

Filters a single-precision image by performing a 2D convolution with an arbitrarily sized kernel.

```
extern void vDSP_imgfir(const float *__A, vDSP_Length __NR, vDSP_Length __NC, const float *__F, float *__C, vDSP_Length __P, vDSP_Length __Q);
```

## Parameters

`__A`

Single-precision real input matrix.

`__NR`

Number of rows in `A`.

`__NC`

Number of columns in `A`.

`__F`

Single-precision real matrix containing the filter.

`__C`

Single-precision real output matrix.

`__P`

Number of rows in `B`; the value of `P` must be odd.

`__Q`

Number of columns in `B`; the value of `Q` must be odd.

## Discussion

This function performs a two-dimensional convolution on the signal `A` using the kernel `B`, leaving results in `C`. The function pads the perimeter of the output image with a border of (*P*-1)/2 rows of zeros on the top and bottom and (*Q*-1)/2 columns of zeros on the left and right:

![mathematical formula](images/com.apple.accelerate/media-2557832@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)