{"id":21304964,"url":"https://github.com/maximilianmairinger/convolution","last_synced_at":"2025-10-06T03:27:31.419Z","repository":{"id":190237173,"uuid":"682251617","full_name":"maximilianMairinger/convolution","owner":"maximilianMairinger","description":"Simple direct and extendable convolution library.","archived":false,"fork":false,"pushed_at":"2023-08-23T22:02:11.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T14:36:04.336Z","etag":null,"topics":["convolution","convolve"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/convolution","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximilianMairinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-23T19:10:59.000Z","updated_at":"2023-08-23T19:11:09.000Z","dependencies_parsed_at":"2025-03-15T19:28:44.559Z","dependency_job_id":"75c673f0-078d-414f-8165-ee4ee40854cb","html_url":"https://github.com/maximilianMairinger/convolution","commit_stats":null,"previous_names":["maximilianmairinger/convolution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maximilianMairinger/convolution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fconvolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fconvolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fconvolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fconvolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximilianMairinger","download_url":"https://codeload.github.com/maximilianMairinger/convolution/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilianMairinger%2Fconvolution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278554701,"owners_count":26006046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convolution","convolve"],"created_at":"2024-11-21T16:16:29.639Z","updated_at":"2025-10-06T03:27:31.384Z","avatar_url":"https://github.com/maximilianMairinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convolution\r\n\r\nPerform convolution operations on one dimensional arrays. This library provides a flexible direct convolution implementation. The library supports both regular arrays and typed arrays.\r\n\r\nNote that this library does not provide a fast (Fast Fourier transform based) convolution implementation. If you are looking for a fast convolution implementation, take a look at [ndarray-convolve](http://npmjs.com/package/ndarray-convolve).\r\n\r\n## Installation\r\n\r\n```shell\r\n $ npm i convolution\r\n```\r\n\r\n## Usage\r\n\r\n### Convolve\r\n\r\n`convolve(a: Array\u003cT\u003e | TypedArray, b: Array\u003cT\u003e | TypedArray): Array\u003cT\u003e | TypedArray`\r\n\r\nPerforms a convolution operation on two arrays one dimensional `a` and `b`. The function returns a new array of the same type as the input, which represents the result of the convolution.\r\n\r\n```ts\r\nimport convolve from \"convolution\"\r\n\r\nconst a = [1, 2, 3]\r\nconst b = [1, 2, 3]\r\n\r\nconst result = convolve(a, b)\r\n// result = [1, 4, 10, 12, 9]\r\n```\r\n\r\n### Convolve Arbitrary\r\n\r\n`convolveArbitrary(convolutionStepFunction: (a: List, b: List) =\u003e T): (a: List, b: List) =\u003e List`\r\n\r\nCreates a convolution function given a custom convolution step function. A convolution step is the operation of combining two arrays of the same length into a single value. Typically this is done by $\\sum_{i}^{}(a_i * b_i)$, but can be arbitrary. The function returns a new function which can be used to perform the whole convolution on two arrays.\r\n\r\nThe following example is the same as the `convolve` function above.\r\n\r\n```ts\r\nimport { convolveArbitrary } from \"convolution\"\r\n\r\nconst convolutionStepFunction = (a, b) =\u003e {\r\n  let sum = 0\r\n  for (let i = 0; i \u003c a.length; i++) {\r\n    sum += a[i] * b[i]\r\n  }\r\n  return sum\r\n}\r\n\r\nconst convolve = convolveArbitrary(convolutionStepFunction)\r\n\r\nconst a = [1, 2, 3]\r\nconst b = [1, 2, 3]\r\n\r\nconst result = convolve(a, b)\r\n// result = [1, 4, 10, 12, 9]\r\n```\r\n\r\n## Supported Typed Arrays\r\n\r\n- Array\r\n- Int8Array\r\n- Uint8Array\r\n- Int16Array\r\n- Uint16Array\r\n- Int32Array\r\n- Uint32Array\r\n- Float32Array\r\n- Float64Array\r\n\r\n## Contribute\r\n\r\nAll feedback is appreciated. Create a pull request or write an issue.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fconvolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximilianmairinger%2Fconvolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilianmairinger%2Fconvolution/lists"}